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 pint an optional dependency #60

Merged
merged 18 commits into from
Jan 24, 2025
Merged

Make pint an optional dependency #60

merged 18 commits into from
Jan 24, 2025

Conversation

eltos
Copy link
Member

@eltos eltos commented Jan 21, 2025

Pint is used for

  • unit conversion
  • unit formatting
  • automatic unit resolving of derived quantities

This makes pint an optional dependency. If not available

  • Attempting unit conversion will fail (the default unit conversions are disabled, e.g. particle coordinate x defaults to units of m if pint is not available instead of mm if pint is available)
  • Unit formatting uses a simplified fallback method
  • Unit resolving will fail

The docs are updated to recommend installation as

pip install xplt[full]

and this is also shown to the user upon failure
grafik

@eltos eltos force-pushed the eltos-pint-optional-dep branch from dd57f2e to a0a24b1 Compare January 21, 2025 16:11
@eltos eltos marked this pull request as ready for review January 21, 2025 16:15
@eltos eltos mentioned this pull request Jan 21, 2025
@eltos eltos enabled auto-merge (rebase) January 24, 2025 14:33
auto-merge was automatically disabled January 24, 2025 14:55

Rebase failed

@eltos eltos merged commit 8454235 into dev Jan 24, 2025
15 checks passed
@eltos eltos deleted the eltos-pint-optional-dep branch January 24, 2025 15:15
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