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

Added the ability to configure the units system using the config file #15

Merged
merged 9 commits into from
May 25, 2023

Conversation

portyanikhin
Copy link
Owner

Available units systems:

  • SI (UnitsSystem.SI):
    • temperature unit - Kelvin (K);
    • decimal fraction unit - dimensionless (from 0 to 1);
  • SI with Celsius (UnitsSystem.SIWithCelsius):
    • temperature unit - degree Celsius (°C);
    • decimal fraction unit - dimensionless (from 0 to 1);
  • SI with Celsius and percents (UnitsSystem.SIWithCelsiusAndPercents) - by default:
    • temperature unit - degree Celsius (°C);
    • decimal fraction unit - percent (%, from 0 to 100).

Available types of config files:

  • pyfluids.ini;
  • pyfluids.json;
  • pyproject.toml;
  • tox.ini.

pyfluids.ini example:

[pyfluids]
units_system = SI

pyfluids.json example:

{
    "pyfluids": {
        "units_system": "SIWithCelsius"
    }
}

pyproject.toml example:

[tool.pyfluids]
units_system = "SIWithCelsiusAndPercents"

tox.ini example:

[pyfluids]
units_system = SI

@portyanikhin portyanikhin linked an issue May 25, 2023 that may be closed by this pull request
@portyanikhin portyanikhin merged commit 43a0648 into main May 25, 2023
@portyanikhin portyanikhin deleted the 8-units-systems branch May 25, 2023 19:41
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.

Unnecessarily stringent checks and exceptions on many operations
1 participant