update: Fixes to allow compatability with newer numpy & pandas #191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I cloned MetaXcan and tried to get it running on a modern Mac, and ran into a couple of problems that seem really easy to fix, so I took a shot at fixing them.
Scipy <1.3 is too old to work on Python 3.9 on an Apple Silicon Mac, but all the tests pass with a much newer scipy so I removed the maximum version requirement.
Numpy 1.20 removed
numpy.str
andnumpy.object
, but those were just references tostr
andobject
so I updated those.pandas.to_numeric()
is removing support forerrors='ignore'
. It still works as of pandas 2.2.1, but is covered in warnings. If exceptions aren't preferred, maybe we could check if the first value in the column is numeric before attempting to convert?https://pandas.pydata.org/docs/reference/api/pandas.to_numeric.html
I also added
sqlalchemy
as an extra requirement if installing to run tests. Would you be interested in moving topyproject.toml
instead ofsetup.py
? I'd be glad to do so: https://packaging.python.org/en/latest/guides/modernize-setup-py-project/All of these changes together make the project installable with
pip install
on a modern system, and all the tests pass.For reference, after removing the scipy max version requirement, these are the package versions I got from a
pip install .
on python 3.9.16 on MacOS 14: