RemDelaporteMathurin / system_code

Tritium Fuel Cycle modelling
MIT License
2 stars 0 forks source link

Adding units #24

Closed shimwell closed 1 year ago

shimwell commented 2 years ago

DRAFT - not ready for review

This is an initial attempt to add units

There are a few things that still need to be cmpleted

convert examples and tests to make use of units

fsolve does not allow units to be passed so find another method of getting the units into the function. Perhaps they can be converted to SI prior to the function then the function can assume they are in SI

RemDelaporteMathurin commented 2 years ago

It seems pint it great but make things a bit complicated. I wonder if it's worth it. A quick and easy way to add units could be to add them to the docstrings, in addition to some conversion tools (these could maybe use pint?)

shimwell commented 2 years ago

Up to you. I guess there are two options.

Allow users to specify values and units. This gives lots of flexibility for users but the user input becomes complicated.

Specify units in docstrings and allow users to input just the values. Convert the values to the specified units internally