fameio 3.0.0__py3-none-any.whl → 3.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CHANGELOG.md +8 -2
- fameio/series.py +4 -6
- {fameio-3.0.0.dist-info → fameio-3.1.0.dist-info}/METADATA +37 -29
- {fameio-3.0.0.dist-info → fameio-3.1.0.dist-info}/RECORD +10 -10
- {fameio-3.0.0.dist-info → fameio-3.1.0.dist-info}/LICENSE.txt +0 -0
- {fameio-3.0.0.dist-info → fameio-3.1.0.dist-info}/LICENSES/Apache-2.0.txt +0 -0
- {fameio-3.0.0.dist-info → fameio-3.1.0.dist-info}/LICENSES/CC-BY-4.0.txt +0 -0
- {fameio-3.0.0.dist-info → fameio-3.1.0.dist-info}/LICENSES/CC0-1.0.txt +0 -0
- {fameio-3.0.0.dist-info → fameio-3.1.0.dist-info}/WHEEL +0 -0
- {fameio-3.0.0.dist-info → fameio-3.1.0.dist-info}/entry_points.txt +0 -0
CHANGELOG.md
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
-
<!-- SPDX-FileCopyrightText:
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025 German Aerospace Center <fame@dlr.de>
|
2
2
|
|
3
3
|
SPDX-License-Identifier: CC0-1.0 -->
|
4
4
|
|
5
|
+
## [3.1.0](https://gitlab.com/fame-framework/fame-io/-/tags/v3.1.0) - 2025-01-29
|
6
|
+
### Changed
|
7
|
+
- Speed up of `makeFameRunConfig` for large CSV files #229 (@dlr-cjs, dlr_fn)
|
8
|
+
- Improve testing of `tools.py` #227 (@dlr_fn)
|
9
|
+
- Reorganize badges in tabular representation in `README.md` #226 (@dlr-cjs, dlr_fn)
|
10
|
+
|
5
11
|
# Changelog
|
6
|
-
## [3.0.0](https://gitlab.com/fame-framework/fame-io/-/tags/v3.0.0) - 2024-02
|
12
|
+
## [3.0.0](https://gitlab.com/fame-framework/fame-io/-/tags/v3.0.0) - 2024-12-02
|
7
13
|
### Changed
|
8
14
|
- **Breaking**: Update to fameprotobuf v2.0.2 #208, #215 (@dlr-cjs)
|
9
15
|
- **Breaking**: Remove section `GeneralProperties.Output` in scenarios - any content there will be ignored #208 (@dlr-cjs)
|
fameio/series.py
CHANGED
@@ -101,12 +101,10 @@ class TimeSeriesManager:
|
|
101
101
|
is_empty = additional_columns.dropna(how="all").empty
|
102
102
|
if not is_empty:
|
103
103
|
log().warning(self._WARN_DATA_IGNORED)
|
104
|
-
data
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
)
|
109
|
-
return data.astype({0: "int64"})
|
104
|
+
if data.dtypes[0] != "int64":
|
105
|
+
data[0] = [FameTime.convert_string_if_is_datetime(time) for time in data[0]]
|
106
|
+
data[1] = [TimeSeriesManager._assert_valid(value) for value in data[1]]
|
107
|
+
return data
|
110
108
|
|
111
109
|
@staticmethod
|
112
110
|
def _assert_valid(value: Any) -> float:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fameio
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.1.0
|
4
4
|
Summary: Tools for input preparation and output digestion of FAME models
|
5
5
|
Home-page: https://gitlab.com/fame-framework/wiki/-/wikis/home
|
6
6
|
License: Apache-2.0
|
@@ -27,27 +27,25 @@ Requires-Dist: pyyaml (>=6.0,<7.0)
|
|
27
27
|
Project-URL: Repository, https://gitlab.com/fame-framework/fame-io/
|
28
28
|
Description-Content-Type: text/markdown
|
29
29
|
|
30
|
-
<!-- SPDX-FileCopyrightText:
|
30
|
+
<!-- SPDX-FileCopyrightText: 2025 German Aerospace Center <fame@dlr.de>
|
31
31
|
|
32
32
|
SPDX-License-Identifier: Apache-2.0 -->
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
[](https://badge.fury.io/py/fameio)
|
37
|
-
[](https://gitlab.com/fame-framework/fame-io/commits/main)
|
38
|
-
|
39
|
-
[](https://github.com/psf/black)
|
40
|
-
[](https://common-changelog.org)
|
42
|
-

|
43
|
-

|
33
|
+
|
34
|
+
| | |
|
35
|
+
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
36
|
+
| **Package** | [](https://badge.fury.io/py/fameio) [](https://badge.fury.io/py/fameio) [](https://api.reuse.software/info/gitlab.com/fame-framework/fame-io) |
|
37
|
+
| **Tests** | [](https://gitlab.com/fame-framework/fame-io/commits/main) [](https://gitlab.com/fame-framework/fame-io/-/commits/main) |
|
38
|
+
| **Activity** |   |
|
39
|
+
| **Style** | [](https://github.com/psf/black) [](https://common-changelog.org) |
|
40
|
+
| **Reference** | [](https://doi.org/10.21105/joss.04958) [](https://doi.org/10.5281/zenodo.4314337) |
|
44
41
|
|
45
42
|
# FAME-Io
|
46
43
|
|
47
44
|
*Tools for input preparation and output digestion of FAME models*
|
48
45
|
|
49
46
|
FAME-Io compiles input for FAME models in protobuf format and extracts model outputs to human-readable files.
|
50
|
-
Please visit the [FAME-Wiki](https://gitlab.com/fame-framework/wiki/-/wikis/home) to get an explanation of FAME and its
|
47
|
+
Please visit the [FAME-Wiki](https://gitlab.com/fame-framework/wiki/-/wikis/home) to get an explanation of FAME and its
|
48
|
+
components.
|
51
49
|
|
52
50
|
# Installation
|
53
51
|
|
@@ -293,12 +291,12 @@ MyComplexAttribute:
|
|
293
291
|
* `NestedAttributes` (required only if `AttributeType: block`, otherwise disallowed) starts an inner Attribute
|
294
292
|
definition block - defined Attributes are sub-elements of `MyComplexAttribute`
|
295
293
|
* `Values` (optional - None by default):
|
296
|
-
|
297
|
-
|
294
|
+
* if present, defines a list or dictionary of allowed values for this attribute
|
295
|
+
* if a dictionary is used, individual Metadata can be assigned to each allowed value using the `Metadata` keyword
|
298
296
|
* `Default` (optional - None by default):
|
299
|
-
|
300
|
-
|
301
|
-
|
297
|
+
* if present, defines a default value to be used if the scenario does not specify one
|
298
|
+
* must match one of the entries in `Values` in case those are defined
|
299
|
+
* can be a list if the attribute is a list
|
302
300
|
* `Help` (optional - None by default): if present, defines a help text for your Attribute
|
303
301
|
* `Metadata` (optional - None by default): if present, defines additional metadata assigned to the Attribute
|
304
302
|
|
@@ -315,6 +313,7 @@ MyComplexAttribute:
|
|
315
313
|
| `block` | this attribute has no value of its own but hosts a group of nested Attributes; implies `NestedAttributes` to be defined |
|
316
314
|
|
317
315
|
#### GeneralProperties
|
316
|
+
|
318
317
|
Specifies FAME-specific properties of the simulation. Structure:
|
319
318
|
|
320
319
|
```yaml
|
@@ -364,8 +363,10 @@ Agent Parameters:
|
|
364
363
|
see attribute table above
|
365
364
|
* `Metadata` Optional; can be assigned to each instance of an Agent, as well as to each of its Attributes
|
366
365
|
|
367
|
-
The specified `Attributes` for each agent must match the specified `Attributes` options in the linked Schema (see
|
368
|
-
|
366
|
+
The specified `Attributes` for each agent must match the specified `Attributes` options in the linked Schema (see
|
367
|
+
above).
|
368
|
+
For better structure and readability of the `scenario.yaml`, `Attributes` may also be specified in a nested way as
|
369
|
+
demonstrated below.
|
369
370
|
|
370
371
|
```yaml
|
371
372
|
Agents:
|
@@ -399,8 +400,10 @@ Nested items `IntValueA` and `IntValueB` of `MyListGroup` are assigned within a
|
|
399
400
|
these nested items several times.
|
400
401
|
|
401
402
|
##### Attribute Metadata
|
403
|
+
|
402
404
|
Metadata can be assigned to any value, list item, or superstructure.
|
403
|
-
To assign Metadata to a primitive value, create a dictionary from it, set the actual value with the inner
|
405
|
+
To assign Metadata to a primitive value, create a dictionary from it, set the actual value with the inner
|
406
|
+
keyword `Value` and add the keyword `Metadata` like this:
|
404
407
|
|
405
408
|
```yaml
|
406
409
|
ValueWithoutMetadata: 1
|
@@ -412,16 +415,16 @@ SameValueWithMetadata:
|
|
412
415
|
You can assign Metadata to a list of primitive values using the keyword `Values` like this:
|
413
416
|
|
414
417
|
```yaml
|
415
|
-
ValueListWithoutMetadata: [1,2,3]
|
418
|
+
ValueListWithoutMetadata: [ 1,2,3 ]
|
416
419
|
SameValueListWithListMetadata:
|
417
|
-
Values: [1,2,3]
|
420
|
+
Values: [ 1,2,3 ]
|
418
421
|
Metadata: # describe the whole list of values with Metadata here
|
419
422
|
```
|
420
423
|
|
421
424
|
or specify Metadata for each (or just some) value individually, like this:
|
422
425
|
|
423
426
|
```yaml
|
424
|
-
ValueListWithoutMetadata: [1,2,3]
|
427
|
+
ValueListWithoutMetadata: [ 1,2,3 ]
|
425
428
|
SameValueListWithMetadataAtEachElement:
|
426
429
|
- Value: 1
|
427
430
|
Metadata: # describe this specific value "1" with Metadata here
|
@@ -432,7 +435,7 @@ SameValueListWithMetadataAtEachElement:
|
|
432
435
|
or assign Metadata to both the list and any of its list entries, like this:
|
433
436
|
|
434
437
|
```yaml
|
435
|
-
ValueListWithoutMetadata: [1,2,3]
|
438
|
+
ValueListWithoutMetadata: [ 1,2,3 ]
|
436
439
|
SameValueListWithAllMetadata:
|
437
440
|
Metadata: # Recommendation: place the Metadata of the list first if the list of values is extensive, as in this case
|
438
441
|
Values:
|
@@ -493,6 +496,7 @@ SameListOfNestedItemsWithGeneralMetadata:
|
|
493
496
|
Again, you may apply both variants and apply Metadata to the list and each of its items if you wish.
|
494
497
|
|
495
498
|
#### Contracts
|
499
|
+
|
496
500
|
Specifies all Contracts, i.e. repetitive bilateral transactions in between agents.
|
497
501
|
Contracts are given as a list.
|
498
502
|
We recommend moving Contracts to separate files and to use the `!include` command to integrate them in the scenario.
|
@@ -528,6 +532,7 @@ Contract Parameters:
|
|
528
532
|
* `Attributes` can be set to include additional information as `int`, `float`, `enum`, or `dict` data types
|
529
533
|
|
530
534
|
##### Definition of Multiple Similar Contracts
|
535
|
+
|
531
536
|
Often, scenarios contain multiple agents of similar type that also have similar chains of contracts.
|
532
537
|
Therefore, FAME-Io supports a compact definition of multiple similar contracts.
|
533
538
|
`SenderId` and `ReceiverId` can both be lists and support One-to-N, N-to-One and N-to-N relations like in the following
|
@@ -636,7 +641,8 @@ These CSV files follow a specific structure:
|
|
636
641
|
|
637
642
|
* They should contain exactly two columns - any other columns are ignored.
|
638
643
|
A warning is raised if more than two non-empty columns are detected.
|
639
|
-
* The first column must be a time stamp in form `YYYY-MM-DD_hh:mm:ss`
|
644
|
+
* The first column must be a time stamp in form `YYYY-MM-DD_hh:mm:ss` or
|
645
|
+
a [FAME-Timestamp](https://gitlab.com/fame-framework/wiki/-/wikis/architecture/decisions/TimeStamp) integer value
|
640
646
|
* The second column must be a numerical value (either integer or floating-point)
|
641
647
|
* The separator of the two columns is a semicolon
|
642
648
|
* The data must **not** have headers, except for comments marked with `#`
|
@@ -654,6 +660,8 @@ Exemplary content of a valid CSV file:
|
|
654
660
|
|
655
661
|
Please refer also to the detailed article about `TimeStamps` in
|
656
662
|
the [FAME-Wiki](https://gitlab.com/fame-framework/wiki/-/wikis/TimeStamp).
|
663
|
+
For large CSV files (with more than 20,000 rows) we recommend using the integer representation of FAME-Timestamps in the
|
664
|
+
first column (instead of text representation) to improve conversion speed.
|
657
665
|
|
658
666
|
### Split and join multiple YAML files
|
659
667
|
|
@@ -862,12 +870,12 @@ The option `--merge-times` requires exactly three integer arguments separated by
|
|
862
870
|
| Second | Steps before | Range of TimeSteps before the `focal-point` they get merged to, must be Zero or positive |
|
863
871
|
| Third | Steps after | Range of TimeSteps after the `focal-point` they get merged to, must be Zero or positive |
|
864
872
|
|
865
|
-
|
866
873
|
This could look as follows:
|
867
874
|
|
868
875
|
convertFameResults -f <./path/to/protobuf_file.pb> -l debug -lf <path/to/output.log> -a AgentType1 AgentType2 -o myCsvFolder -m -cc SPLIT --merge-times 0 1799 1800
|
869
876
|
|
870
|
-
Make sure that in the range of time steps you specify for merging, there is only one value per column in the merged time
|
877
|
+
Make sure that in the range of time steps you specify for merging, there is only one value per column in the merged time
|
878
|
+
range.
|
871
879
|
If multiple values per column are merged values will get concatenated and might yield unexpected results.
|
872
880
|
|
873
881
|
You may also call the conversion script from any Python script with:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
CHANGELOG.md,sha256=
|
1
|
+
CHANGELOG.md,sha256=2RFfQpBVhdLZ78_XZu2_B_sLe4RFb-iL_aH1PfrRPLY,14111
|
2
2
|
fameio/__init__.py,sha256=LiE7kRXW0pMIB4hTPC0T_ppGz9O0swd0Ca1-b99hOMc,229
|
3
3
|
fameio/cli/__init__.py,sha256=xAS0gRfzq1qepCW6PjIozRC6t3DOxzdNvHU9beFOGHU,167
|
4
4
|
fameio/cli/convert_results.py,sha256=-nAAuO_CznggZnZHeGctP_uXcQsQGjTDDZmHAqlBMJQ,3438
|
@@ -43,14 +43,14 @@ fameio/scripts/convert_results.py,sha256=Olrw4l9nGzstgdVyhJJthHCKyaTubVXSlM26729
|
|
43
43
|
fameio/scripts/convert_results.py.license,sha256=2-OqCNxP4504xY2XQqseYypJi1_Qx4xJSzO3t7c3ACM,107
|
44
44
|
fameio/scripts/make_config.py,sha256=LvwXbBlaGdKC25BRlk4LJDEwvZzxzCzYyVewtyHhIMM,1351
|
45
45
|
fameio/scripts/make_config.py.license,sha256=2-OqCNxP4504xY2XQqseYypJi1_Qx4xJSzO3t7c3ACM,107
|
46
|
-
fameio/series.py,sha256=
|
46
|
+
fameio/series.py,sha256=FhORd6MmBnAzCC56Nb-REhadPd-d5BxBpRjkOJ-yEaA,9107
|
47
47
|
fameio/time.py,sha256=iiCVpEmBSxHgKft_X-E_D-dpOT-L2Y_xN-6pVFtJhDQ,6949
|
48
48
|
fameio/tools.py,sha256=8Ia-J-mgjf1NCXMvjLDj10hDwEKzp6jS6eq6z8W005w,1056
|
49
|
-
fameio-3.
|
50
|
-
fameio-3.
|
51
|
-
fameio-3.
|
52
|
-
fameio-3.
|
53
|
-
fameio-3.
|
54
|
-
fameio-3.
|
55
|
-
fameio-3.
|
56
|
-
fameio-3.
|
49
|
+
fameio-3.1.0.dist-info/entry_points.txt,sha256=jvQVfwJjZXPWQjJlhj1Dt6PTeblryTc1GxjKeK90twI,123
|
50
|
+
fameio-3.1.0.dist-info/LICENSE.txt,sha256=eGHBZnhr9CWjE95SWjRfmhtK1lvVn5X4Fpf3KrrAZDg,10391
|
51
|
+
fameio-3.1.0.dist-info/LICENSES/Apache-2.0.txt,sha256=eGHBZnhr9CWjE95SWjRfmhtK1lvVn5X4Fpf3KrrAZDg,10391
|
52
|
+
fameio-3.1.0.dist-info/LICENSES/CC-BY-4.0.txt,sha256=y9WvMYKGt0ZW8UXf9QkZB8wj1tjJrQngKR7CSXeSukE,19051
|
53
|
+
fameio-3.1.0.dist-info/LICENSES/CC0-1.0.txt,sha256=9Ofzc7m5lpUDN-jUGkopOcLZC3cl6brz1QhKInF60yg,7169
|
54
|
+
fameio-3.1.0.dist-info/METADATA,sha256=r5SZ8p7ee6a3f6wEUCWZOUdsjdF3yFZb4G_X-cQRVrk,38857
|
55
|
+
fameio-3.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
56
|
+
fameio-3.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|