Skip to content

Add conditional imports for heavier packages #237

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

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

anth-volk
Copy link
Collaborator

Fixes #236.

This adds conditional imports for matplotlib and seaborn for the few relevant functions where they are necessary. It also adds a [charts] install option to setup.py to enable the install of these, and uses try/except blocks to ensure the packages are installed.

This was tested locally by manually importing and running tests from -core and -us against.

Following the merging of this, I intend to do the following:

  • Tag as v0.4.0
  • Add a corresponding GitHub release
  • Build a distribution locally via Twine
  • Release to PyPI manually (once granted access)
  • Open PR in -core removing the duplicative microdf code from it and installing this version
  • Open PRs in -us and -uk to upgrade to this version, as most of their code does not use -core's duplicative version of microdf

@MaxGhenis MaxGhenis merged commit 1419cf5 into PolicyEngine:master Oct 24, 2024
5 checks passed
@anth-volk anth-volk deleted the fix/conditional-imports branch October 24, 2024 22:14
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.

Remove heavy imports and add conditional imports to allow for use of package without modification in -core
2 participants