Data processing for applications using IDSs or CBS
Project description
Data Processing Library
Data processing for IMAS, CODAC data.
Requirements
- python <= 3.11
- Dependencies: Managed via pyproject.toml.
Install the package from PyPi:
pip install iplotProcessing
Installation with optional dependencies
You can also install optional dependencies (e.g. test):
pip install "iplotProcessing[test]"
Structure
├── common # ParameterID functions, table helpers, exceptions
├── core # core data objects will be managed by a context i.e, user/developer's contact with signal processing methods
├── math # Mathematical and signal-processing utilities, including numerical computations, data pre-processing and expression evaluation
├── tests
└── tools # additional tools that don't fit in core or context
- The context can initialize itself from a pandas DataFrame or a csv file.
- The delimiter is customizable. Commonly used delimiter is ','.
- The ',' delimiter causes a disambiguity when a field has a function with two or more arguments separated by ','
- Ex: convolve(${self}.time, ones(5))
- As the table (pd.DataFrame) is read, aliases are registered and new signals are added.
- An alias can refer to
- a data source and a variable name
- an expression involving one or more variable names
- an expression involving one or more aliases
- Aliases can be used before their definition.
- The implementation makes sure aliases are available prior to addition of new signals.
|--------------ENVIRONMENT-------------|
|hash(params): Signal |
|hash(params): Signal |
|hash(params): Signal |
|some_alias: hash(params) |
|hash(params): Signal |
|hash(params): Signal |
|hash(params): Signal |
|hash(params): Signal |
|hash(params): Signal |
|hash(params): Signal |
|hash(params): Signal |
|some_alias: hash(params) |
|some_alias: hash(params) |
|hash(params): Signal |
|some_alias: hash(params) |
|some_alias: hash(params) |
|some_alias: hash(params) |
|some_alias: hash(params) |
|...:... |
|...:... |
|...:... |
|...:... |
|...:... |
|...:... |
|...:... |
|...:... |
|...:... |
|...:... |
|--------------------------------------|
Implementation
- The context will have a global environment
- The environment
- is a hash-value dictionary
- uses a
blueprint.jsonfile to- specifies labels
- initialize the column names from labels or the key names
- specifies
code_namethat shall be used for the parameters in Python code. - create hash from parameters with
no_hash=True - construct a signal from parameters without the
no_construct=True - specifies the type of the parameter
- specifies the default values
- indicates if a parameter's value (when specified in the row) should override the default
- For example,
- considering a codacuda DS, the variable name is a series of alpha-numeric characters that the iplotDataAccess module can understand.
- considering an imasuda DS, the variable name is a forward-slash separated sequence of words or numbers inside square-brackets (in case of AoS). Obviously, only the iplotDataAccess module can understand it.
- The value in the dictionary for a given key is a
core/Signalobject - We will have to somehow initialize a
core/Signalobject populated with the time, data members prior to evaluating the expression. - The key must also encode the data-source.
- Ex: varname=IP1, DS=JET and varname=IP1, DS=codacuda must be unique.
- The hash will be constructed from a set of parameters that have the
no_hashvalue set totrue
- The procedure to add a Signal,
- Context will need a variable name and a data source.
- Ex. with codacuda DS, something like
${SignalName-X-Y-Z}+${SignalNameOther}or simplySignalName-X-Y-Z - Ex. with imasuda DS, something like
${core_profiles/profiles_1d/j_ohmic} + ${something/similar/to/the/previous/one}or simplycore_profiles/profiles_1d/j_ohmic
- Ex. with codacuda DS, something like
- Context uses a parsing tool to decode the input expression.
- insert the key-value (varname: resource) in the global environment.
- resource is a Signal.
- During this stage the environment cannot yet be used to evaluate expressions.
- The Signal's input expression should contain entries that are hash values (from the environment)
- At the time of addition, the Signal's input expression is in ASCII format.
- The parsing tool can interpret keys from its varDict, localDict member.
- It is required to build the context map.
- The process of building the context map implies that the existing environment must be used in the Signal's input expression.
- Context will need a variable name and a data source.
- An expression can be evaluated with the context.
- It might have call some function to fetch the resource
- So expose a callback that shall be used to fetch the resource. This can be set in the user-app
- The callback parameters could be time range, pulse number, no. of samples, ...
- You are only required to provide a callback that will initialize a resource for a signal
- now eval the expression.
core/Signalhas implementations for every mathematical operation and other complex stuff too(__getitem__). So ${Sig1} + ${Sig2} evaluates correctly in python. - The local environment is setup as a throw-away dictionary for current evaluation.
- The
evaluatefunction will initialize a couple keys in the local environment.time: the time base. (represented bySignal.time)data: the ydata in case of 1D signals. (represented bySignal.data)data_primary: alias for data. (represented bySignal.data_primary)data_secondary: the position vector in case of 2D signals. (ex: r in Te = f(r, t)) (represented bySignal.data_secondary)time_unit: represented bySignal.time_unitdata_unit: represented bydata.unitdata_primary_unit: represented bydata_primary.unitdata_secondary_unit:represented bydata_secondary.unit- more to come..
- ....
selfin python means the object itself. Similarly, proposed syntax to access the current row's signal's members is- Ex: for time access,
${self}.time - Ex: for data access,
${self}.data
- Ex: for time access,
- So, all of these would evaluate correctly accordint the python data-member access syntax
${self}.time= The membertimeof thecore/Signalobject for the processor corresponding to current row.${Johm}.time= The membertimeof thecore/Signalobject registered under the alias Johm in the global environment.(ml0002+ml0004)/1= The sum of twocore/Signalobjects which are registered under the aliasml0002andml0004. Recall that mathematical operations oncore/Signalobjects are performed on the data with proper time mixing/interpolation. Sincecore/Signalshall implement__add__and other mathematical ops. See operators for some of the mathematical operatorscore/Signalshall implement. Basic '+', '*', '-', '/', etc.
- If the alias was registered, its valid to query an expression containing the alias.
- It might have call some function to fetch the resource
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iplotprocessing-1.2.1.tar.gz.
File metadata
- Download URL: iplotprocessing-1.2.1.tar.gz
- Upload date:
- Size: 47.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb158223f9542d107fc07ada4218bc3c606cad1a659d44b6318b7767cb96fec6
|
|
| MD5 |
4aecda649b718f1d59e5eef5c211f2f6
|
|
| BLAKE2b-256 |
145383656e160dfefa81d24e76526dc6d1194624b8234ce51c7dca3e279660ad
|
Provenance
The following attestation bundles were made for iplotprocessing-1.2.1.tar.gz:
Publisher:
publish.yml on iplot-viz/iplotprocessing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iplotprocessing-1.2.1.tar.gz -
Subject digest:
eb158223f9542d107fc07ada4218bc3c606cad1a659d44b6318b7767cb96fec6 - Sigstore transparency entry: 1692376883
- Sigstore integration time:
-
Permalink:
iplot-viz/iplotprocessing@a0931f19f136f18109535a7b95b15f08cc66f5ca -
Branch / Tag:
refs/tags/1.2.1 - Owner: https://github.com/iplot-viz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0931f19f136f18109535a7b95b15f08cc66f5ca -
Trigger Event:
release
-
Statement type:
File details
Details for the file iplotprocessing-1.2.1-py3-none-any.whl.
File metadata
- Download URL: iplotprocessing-1.2.1-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2521587632b55c077990d669eccae3bfe6ac8c2a2cb289d063360c0ff3aec0ec
|
|
| MD5 |
b8d3ec7ef93f94f5a4ca6898a8de175f
|
|
| BLAKE2b-256 |
7a3aedc48046444a7a53ad78ff52a3f73b6716b32216dfb5aac923f003eaae1d
|
Provenance
The following attestation bundles were made for iplotprocessing-1.2.1-py3-none-any.whl:
Publisher:
publish.yml on iplot-viz/iplotprocessing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iplotprocessing-1.2.1-py3-none-any.whl -
Subject digest:
2521587632b55c077990d669eccae3bfe6ac8c2a2cb289d063360c0ff3aec0ec - Sigstore transparency entry: 1692377011
- Sigstore integration time:
-
Permalink:
iplot-viz/iplotprocessing@a0931f19f136f18109535a7b95b15f08cc66f5ca -
Branch / Tag:
refs/tags/1.2.1 - Owner: https://github.com/iplot-viz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0931f19f136f18109535a7b95b15f08cc66f5ca -
Trigger Event:
release
-
Statement type: