Parametrization made easy
Project description
Ir. E. van Vliet
24-07-2023
Carg-io
cargi-io
supports defining, setting and bookkeeping when working with sets of parameters.
cargi-io
originated as an alternative to using the python-native dataclass
, since dataclasses
did not really offer the functionality needed for parametric analyses.
Features
- Unit conversion
- Assigning default values
- Linting and autocompletion
- Hashing
- Iteration
- Representations for
pandas.dataframe
andtkinter
Examples:
Independent parameters
Below an example of how to organize the input parameters for a box object.
from carg_io import ParameterSet, Parameter, units
class Box(ParameterSet):
Length:Parameter = 1 * units.meter
Width:Parameter = 1 * units.meter
Height:Parameter = 1 * units.meter
Density:Parameter = 2 * units.kilogram / units.meter**3
if __name__ == "__main__":
box = Box()
box.Length['m'] = 2
assert box.Length['mm'] == 2000
Dependent parameter
In the example below, Box.Volume
is a dependent parameter that uses the length, width and height of the box.
from carg_io import ParameterSet, Parameter, units
class Box(ParameterSet):
Length:Parameter = 1 * units.meter
Width:Parameter = 1 * units.meter
Height:Parameter = 1 * units.meter
Density:Parameter = 2 * units.kilogram / units.meter**3
def Volume(self) -> Parameter:
l = self.Length['m']
w = self.Width['m']
h = self.Height['m']
return Parameter('Volume', l*w*h*units.meter**3)
No categorical data
Categorical data, such as as choice between GREEN
, BLUE
, YELLOW
, is deliberately not supported.
The reason for this is that carg-io
focusses on numerical values only, since only numerical values can be shown in a graph.
Typically, digging deeper into categorical values, one will eventually find numerical values again. E.g. the colors GREEN
, BLUE
and YELLOW
are actually wave lenghts 550, 450 and 580 nm.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file carg_io-1.0b0.tar.gz
.
File metadata
- Download URL: carg_io-1.0b0.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd4fd6be85a5644df7433c9bebddaad4112a653d06b8de98993dbff282b73dc6 |
|
MD5 | 7337dc533848424cf26b1e26b51d6176 |
|
BLAKE2b-256 | 21e960c90500bad5b23e08c70585484c41b42bf4ee862178d0027b9c8d961530 |
File details
Details for the file carg_io-1.0b0-py3-none-any.whl
.
File metadata
- Download URL: carg_io-1.0b0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcbe7019ee36c49927c398d386d776095819c7e916de9e2a9480b45dc9437a33 |
|
MD5 | 170bd4c51e166394b860edda6872124d |
|
BLAKE2b-256 | bf9ffa5f5c610b83f1bafce15fbd419323e207305801678a159bba0b60aa01e4 |