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.
this required a fair amount of refactoring to avoid a circular dependency generated by the fact that the unit systems currently store Unit objects. That's not actually necessary, the unit systems only need to store the units that make up the system and can generate Unit objects to return to the user when
__getitem__
is called.Now that unit registries are associated with a unit system, the registry can be used to determine the appropriate unit system to use for a calculation. This allows the unit system to be controlled by an application by making use of a custom unit registry. Calls to in_base or get_base_equivalent will return data in the appropriately configured unit system associated with that registry.
I haven't yet added configuration for unit systems, but this at least makes it possible for application authors to have their own custom default unit system, as long as they make sure to always use their custom unit registry when they create new arrays.