Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brightway-lca/brightway2-parameters
Library for storing, validating, and calculating with parameters
https://github.com/brightway-lca/brightway2-parameters
Last synced: about 2 months ago
JSON representation
Library for storing, validating, and calculating with parameters
- Host: GitHub
- URL: https://github.com/brightway-lca/brightway2-parameters
- Owner: brightway-lca
- License: bsd-3-clause
- Created: 2020-03-03T09:26:17.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-17T21:48:19.000Z (7 months ago)
- Last Synced: 2024-10-31T17:42:54.135Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 146 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Brightway2 parameters
Library for storing, validating, and calculating with parameters. Designed to work with the [Brightway2 life cycle assessment framework](https://brightwaylca.org), but is generic enough to work in other use cases.
In [1]: from bw2parameters import ParameterSet
In [2]: parameters = {
...: 'Deep_Thought': {'amount': 42},
...: 'East_River_Creature': {'formula': '2 * Deep_Thought + 16'},
...: 'Elders_of_Krikkit': {'formula': 'sqrt(East_River_Creature)'},
...: }In [3]: ParameterSet(parameters).evaluate()
Out[3]: {'Deep_Thought': 42, 'East_River_Creature': 100, 'Elders_of_Krikkit': 10.0}Compatible with Python 2.7 and 3.3+. 100% test coverage.