Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dependency Compatibility #2716

Merged
merged 11 commits into from
Aug 14, 2023

Conversation

mikejhuang
Copy link
Contributor

Include Python 3.11 compatibility, unpeg all dependencies and fix breaking changes from updated packages or downgrade packages.

Steps

1.Unpin requirements.txt
2. Use poetry to setup supported python version range into pyproject.toml
4. Add requirements.txt dependencies with poetry and resolve Python version compatibility issues
5. xarray, scipy, and numpy versions adjusted to meet python version requirements
6. Run tests by creating virtualenv with 3.8, 3.9, 3.10, 3.11
7. For failing tests, either fix code or revert package version
Final explicitly defined requirements
8. Remove poetry created files (pyproject.toml, poetry.lock)

Fixes for compatibility

  1. pandas 1.1.5 -> 2.0.3
  2. numpy 1.23.5
    • np.bool, np.float, np.int are deprecated. Use 'bool', 'float', or 'int' instead.

Reverting versions instead of fixing

  1. hdmf=<3.4.7
  2. pandas<2.0.0
    • padas==2.0.3: VisualBehaviorProjectCache.get_ophys_session_table( index_column="ophys_experiment_id").index is type 'object', expected int64
      All the values in this index are int64 so I'm not sure why it was loaded as an object type.

@mikejhuang mikejhuang changed the title Psb-172/update_dependency_compatibility Update Dependency Compatibility Aug 10, 2023
@mikejhuang mikejhuang force-pushed the psb-172/update_dependency_compatibility branch from 621920d to 4e65a29 Compare August 11, 2023 16:42
Copy link
Contributor

@morriscb morriscb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One quick question about a np.bool_ vs bool_ choice but other than that looks good. Also don't forget to lint.

@@ -164,7 +164,7 @@ def json_handler(obj):
return float(obj)
elif isinstance(obj, np.integer):
return int(obj)
elif (isinstance(obj, np.bool) or
elif (isinstance(obj, bool) or
isinstance(obj, np.bool_)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to make sure this one shouldn't also be changed to bool_ as interval_unionize/data_utilities.py was switched from np.bool_ to bool_.

@mikejhuang mikejhuang merged commit e768fcc into rc/2.16.0 Aug 14, 2023
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants