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

make dm-tree optional #2379

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Conversation

OriolAbril
Copy link
Member

@OriolAbril OriolAbril commented Sep 11, 2024

Description

dm-tree dependency is only used to support pytree objects like nested dicts which
is not very common and is also very localized in the codebase, being only used via
either dict_to_dataset or from_dict (both also having the dict->pytree alternative naming).

I would like to keep dependencies for base functionality to something more basic so
we can for example use arviz via pyodide. Also in preparation to arviz-xyz refactoring
where anything not required throughout the library is an optional dependency.

Checklist

  • Follows official PR format
  • Includes a sample plot to visually illustrate the changes (only for plot-related functions)
  • New features are properly documented (with an example if appropriate)?
  • Includes new or updated tests to cover the new feature
  • Code style correct (follows pylint and black guidelines)
  • Changes are listed in changelog

📚 Documentation preview 📚: https://arviz--2379.org.readthedocs.build/en/2379/

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.00%. Comparing base (5a928fb) to head (a42010c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
arviz/data/base.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2379   +/-   ##
=======================================
  Coverage   86.99%   87.00%           
=======================================
  Files         124      124           
  Lines       12862    12877   +15     
=======================================
+ Hits        11189    11203   +14     
- Misses       1673     1674    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ColCarroll ColCarroll left a comment

Choose a reason for hiding this comment

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

Looks good to me!

I picked dm-tree as less weird of a dependency than jax, but the latter is probably way more common (especially if the user has a pytree or nested dict). I might open an issue (or just make the PR) to allow tree to be either dm-tree or jax.tree.

@OriolAbril OriolAbril merged commit eb692cb into arviz-devs:main Sep 11, 2024
12 checks passed
@OriolAbril OriolAbril deleted the pytree_optional branch September 11, 2024 16:02
@OriolAbril
Copy link
Member Author

to allow tree to be either dm-tree or jax.tree.

That would be nice

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