fameio 3.0.0__tar.gz → 3.1.0__tar.gz

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.
Files changed (55) hide show
  1. {fameio-3.0.0 → fameio-3.1.0}/CHANGELOG.md +8 -2
  2. {fameio-3.0.0 → fameio-3.1.0}/PKG-INFO +37 -29
  3. {fameio-3.0.0 → fameio-3.1.0}/README.md +36 -28
  4. {fameio-3.0.0 → fameio-3.1.0}/pyproject.toml +1 -1
  5. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/series.py +4 -6
  6. {fameio-3.0.0 → fameio-3.1.0}/LICENSE.txt +0 -0
  7. {fameio-3.0.0 → fameio-3.1.0}/LICENSES/Apache-2.0.txt +0 -0
  8. {fameio-3.0.0 → fameio-3.1.0}/LICENSES/CC-BY-4.0.txt +0 -0
  9. {fameio-3.0.0 → fameio-3.1.0}/LICENSES/CC0-1.0.txt +0 -0
  10. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/__init__.py +0 -0
  11. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/cli/__init__.py +0 -0
  12. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/cli/convert_results.py +0 -0
  13. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/cli/make_config.py +0 -0
  14. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/cli/options.py +0 -0
  15. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/cli/parser.py +0 -0
  16. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/__init__.py +0 -0
  17. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/loader/__init__.py +0 -0
  18. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/loader/controller.py +0 -0
  19. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/loader/loader.py +0 -0
  20. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/metadata.py +0 -0
  21. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/resolver.py +0 -0
  22. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/__init__.py +0 -0
  23. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/agent.py +0 -0
  24. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/attribute.py +0 -0
  25. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/contract.py +0 -0
  26. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/exception.py +0 -0
  27. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/fameiofactory.py +0 -0
  28. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/generalproperties.py +0 -0
  29. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/scenario.py +0 -0
  30. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/scenario/stringset.py +0 -0
  31. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/schema/__init__.py +0 -0
  32. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/schema/agenttype.py +0 -0
  33. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/schema/attribute.py +0 -0
  34. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/schema/java_packages.py +0 -0
  35. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/schema/schema.py +0 -0
  36. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/validator.py +0 -0
  37. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/input/writer.py +0 -0
  38. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/logs.py +0 -0
  39. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/__init__.py +0 -0
  40. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/agent_type.py +0 -0
  41. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/conversion.py +0 -0
  42. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/csv_writer.py +0 -0
  43. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/data_transformer.py +0 -0
  44. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/input_dao.py +0 -0
  45. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/output_dao.py +0 -0
  46. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/reader.py +0 -0
  47. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/output/yaml_writer.py +0 -0
  48. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/scripts/__init__.py +0 -0
  49. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/scripts/__init__.py.license +0 -0
  50. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/scripts/convert_results.py +0 -0
  51. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/scripts/convert_results.py.license +0 -0
  52. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/scripts/make_config.py +0 -0
  53. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/scripts/make_config.py.license +0 -0
  54. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/time.py +0 -0
  55. {fameio-3.0.0 → fameio-3.1.0}/src/fameio/tools.py +0 -0
@@ -1,9 +1,15 @@
1
- <!-- SPDX-FileCopyrightText: 2024 German Aerospace Center <fame@dlr.de>
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
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fameio
3
- Version: 3.0.0
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: 2024 German Aerospace Center <fame@dlr.de>
30
+ <!-- SPDX-FileCopyrightText: 2025 German Aerospace Center <fame@dlr.de>
31
31
 
32
32
  SPDX-License-Identifier: Apache-2.0 -->
33
- [![PyPI version](https://badge.fury.io/py/fameio.svg)](https://badge.fury.io/py/fameio)
34
- [![JOSS](https://joss.theoj.org/papers/10.21105/joss.04958/status.svg)](https://doi.org/10.21105/joss.04958)
35
- [![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.4314337.svg)](https://doi.org/10.5281/zenodo.4314337)
36
- [![PyPI license](https://img.shields.io/pypi/l/fameio.svg)](https://badge.fury.io/py/fameio)
37
- [![pipeline status](https://gitlab.com/fame-framework/fame-io/badges/main/pipeline.svg)](https://gitlab.com/fame-framework/fame-io/commits/main)
38
- [![coverage report](https://gitlab.com/fame-framework/fame-io/badges/main/coverage.svg)](https://gitlab.com/fame-framework/fame-io/-/commits/main)
39
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
40
- [![REUSE status](https://api.reuse.software/badge/gitlab.com/fame-framework/fame-io)](https://api.reuse.software/info/gitlab.com/fame-framework/fame-io)
41
- [![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)
42
- ![GitLab last commit](https://img.shields.io/gitlab/last-commit/fame-framework%2Ffame-io)
43
- ![GitLab closed issues by-label](https://img.shields.io/gitlab/issues/closed/fame-framework%2Ffame-io)
33
+
34
+ | | |
35
+ |---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
36
+ | **Package** | [![PyPI version](https://badge.fury.io/py/fameio.svg)](https://badge.fury.io/py/fameio) [![PyPI license](https://img.shields.io/pypi/l/fameio.svg)](https://badge.fury.io/py/fameio) [![REUSE status](https://api.reuse.software/badge/gitlab.com/fame-framework/fame-io)](https://api.reuse.software/info/gitlab.com/fame-framework/fame-io) |
37
+ | **Tests** | [![pipeline status](https://gitlab.com/fame-framework/fame-io/badges/main/pipeline.svg)](https://gitlab.com/fame-framework/fame-io/commits/main) [![coverage report](https://gitlab.com/fame-framework/fame-io/badges/main/coverage.svg)](https://gitlab.com/fame-framework/fame-io/-/commits/main) |
38
+ | **Activity** | ![GitLab last commit](https://img.shields.io/gitlab/last-commit/fame-framework%2Ffame-io) ![GitLab closed issues by-label](https://img.shields.io/gitlab/issues/closed/fame-framework%2Ffame-io) |
39
+ | **Style** | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org) |
40
+ | **Reference** | [![JOSS](https://joss.theoj.org/papers/10.21105/joss.04958/status.svg)](https://doi.org/10.21105/joss.04958) [![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.4314337.svg)](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 components.
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
- * if present, defines a list or dictionary of allowed values for this attribute
297
- * if a dictionary is used, individual Metadata can be assigned to each allowed value using the `Metadata` keyword
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
- * if present, defines a default value to be used if the scenario does not specify one
300
- * must match one of the entries in `Values` in case those are defined
301
- * can be a list if the attribute is a list
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 above).
368
- For better structure and readability of the `scenario.yaml`, `Attributes` may also be specified in a nested way as demonstrated below.
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 keyword `Value` and add the keyword `Metadata` like this:
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 range.
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,24 +1,22 @@
1
- <!-- SPDX-FileCopyrightText: 2024 German Aerospace Center <fame@dlr.de>
1
+ <!-- SPDX-FileCopyrightText: 2025 German Aerospace Center <fame@dlr.de>
2
2
 
3
3
  SPDX-License-Identifier: Apache-2.0 -->
4
- [![PyPI version](https://badge.fury.io/py/fameio.svg)](https://badge.fury.io/py/fameio)
5
- [![JOSS](https://joss.theoj.org/papers/10.21105/joss.04958/status.svg)](https://doi.org/10.21105/joss.04958)
6
- [![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.4314337.svg)](https://doi.org/10.5281/zenodo.4314337)
7
- [![PyPI license](https://img.shields.io/pypi/l/fameio.svg)](https://badge.fury.io/py/fameio)
8
- [![pipeline status](https://gitlab.com/fame-framework/fame-io/badges/main/pipeline.svg)](https://gitlab.com/fame-framework/fame-io/commits/main)
9
- [![coverage report](https://gitlab.com/fame-framework/fame-io/badges/main/coverage.svg)](https://gitlab.com/fame-framework/fame-io/-/commits/main)
10
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
11
- [![REUSE status](https://api.reuse.software/badge/gitlab.com/fame-framework/fame-io)](https://api.reuse.software/info/gitlab.com/fame-framework/fame-io)
12
- [![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)
13
- ![GitLab last commit](https://img.shields.io/gitlab/last-commit/fame-framework%2Ffame-io)
14
- ![GitLab closed issues by-label](https://img.shields.io/gitlab/issues/closed/fame-framework%2Ffame-io)
4
+
5
+ | | |
6
+ |---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
7
+ | **Package** | [![PyPI version](https://badge.fury.io/py/fameio.svg)](https://badge.fury.io/py/fameio) [![PyPI license](https://img.shields.io/pypi/l/fameio.svg)](https://badge.fury.io/py/fameio) [![REUSE status](https://api.reuse.software/badge/gitlab.com/fame-framework/fame-io)](https://api.reuse.software/info/gitlab.com/fame-framework/fame-io) |
8
+ | **Tests** | [![pipeline status](https://gitlab.com/fame-framework/fame-io/badges/main/pipeline.svg)](https://gitlab.com/fame-framework/fame-io/commits/main) [![coverage report](https://gitlab.com/fame-framework/fame-io/badges/main/coverage.svg)](https://gitlab.com/fame-framework/fame-io/-/commits/main) |
9
+ | **Activity** | ![GitLab last commit](https://img.shields.io/gitlab/last-commit/fame-framework%2Ffame-io) ![GitLab closed issues by-label](https://img.shields.io/gitlab/issues/closed/fame-framework%2Ffame-io) |
10
+ | **Style** | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org) |
11
+ | **Reference** | [![JOSS](https://joss.theoj.org/papers/10.21105/joss.04958/status.svg)](https://doi.org/10.21105/joss.04958) [![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.4314337.svg)](https://doi.org/10.5281/zenodo.4314337) |
15
12
 
16
13
  # FAME-Io
17
14
 
18
15
  *Tools for input preparation and output digestion of FAME models*
19
16
 
20
17
  FAME-Io compiles input for FAME models in protobuf format and extracts model outputs to human-readable files.
21
- Please visit the [FAME-Wiki](https://gitlab.com/fame-framework/wiki/-/wikis/home) to get an explanation of FAME and its components.
18
+ Please visit the [FAME-Wiki](https://gitlab.com/fame-framework/wiki/-/wikis/home) to get an explanation of FAME and its
19
+ components.
22
20
 
23
21
  # Installation
24
22
 
@@ -264,12 +262,12 @@ MyComplexAttribute:
264
262
  * `NestedAttributes` (required only if `AttributeType: block`, otherwise disallowed) starts an inner Attribute
265
263
  definition block - defined Attributes are sub-elements of `MyComplexAttribute`
266
264
  * `Values` (optional - None by default):
267
- * if present, defines a list or dictionary of allowed values for this attribute
268
- * if a dictionary is used, individual Metadata can be assigned to each allowed value using the `Metadata` keyword
265
+ * if present, defines a list or dictionary of allowed values for this attribute
266
+ * if a dictionary is used, individual Metadata can be assigned to each allowed value using the `Metadata` keyword
269
267
  * `Default` (optional - None by default):
270
- * if present, defines a default value to be used if the scenario does not specify one
271
- * must match one of the entries in `Values` in case those are defined
272
- * can be a list if the attribute is a list
268
+ * if present, defines a default value to be used if the scenario does not specify one
269
+ * must match one of the entries in `Values` in case those are defined
270
+ * can be a list if the attribute is a list
273
271
  * `Help` (optional - None by default): if present, defines a help text for your Attribute
274
272
  * `Metadata` (optional - None by default): if present, defines additional metadata assigned to the Attribute
275
273
 
@@ -286,6 +284,7 @@ MyComplexAttribute:
286
284
  | `block` | this attribute has no value of its own but hosts a group of nested Attributes; implies `NestedAttributes` to be defined |
287
285
 
288
286
  #### GeneralProperties
287
+
289
288
  Specifies FAME-specific properties of the simulation. Structure:
290
289
 
291
290
  ```yaml
@@ -335,8 +334,10 @@ Agent Parameters:
335
334
  see attribute table above
336
335
  * `Metadata` Optional; can be assigned to each instance of an Agent, as well as to each of its Attributes
337
336
 
338
- The specified `Attributes` for each agent must match the specified `Attributes` options in the linked Schema (see above).
339
- For better structure and readability of the `scenario.yaml`, `Attributes` may also be specified in a nested way as demonstrated below.
337
+ The specified `Attributes` for each agent must match the specified `Attributes` options in the linked Schema (see
338
+ above).
339
+ For better structure and readability of the `scenario.yaml`, `Attributes` may also be specified in a nested way as
340
+ demonstrated below.
340
341
 
341
342
  ```yaml
342
343
  Agents:
@@ -370,8 +371,10 @@ Nested items `IntValueA` and `IntValueB` of `MyListGroup` are assigned within a
370
371
  these nested items several times.
371
372
 
372
373
  ##### Attribute Metadata
374
+
373
375
  Metadata can be assigned to any value, list item, or superstructure.
374
- To assign Metadata to a primitive value, create a dictionary from it, set the actual value with the inner keyword `Value` and add the keyword `Metadata` like this:
376
+ To assign Metadata to a primitive value, create a dictionary from it, set the actual value with the inner
377
+ keyword `Value` and add the keyword `Metadata` like this:
375
378
 
376
379
  ```yaml
377
380
  ValueWithoutMetadata: 1
@@ -383,16 +386,16 @@ SameValueWithMetadata:
383
386
  You can assign Metadata to a list of primitive values using the keyword `Values` like this:
384
387
 
385
388
  ```yaml
386
- ValueListWithoutMetadata: [1,2,3]
389
+ ValueListWithoutMetadata: [ 1,2,3 ]
387
390
  SameValueListWithListMetadata:
388
- Values: [1,2,3]
391
+ Values: [ 1,2,3 ]
389
392
  Metadata: # describe the whole list of values with Metadata here
390
393
  ```
391
394
 
392
395
  or specify Metadata for each (or just some) value individually, like this:
393
396
 
394
397
  ```yaml
395
- ValueListWithoutMetadata: [1,2,3]
398
+ ValueListWithoutMetadata: [ 1,2,3 ]
396
399
  SameValueListWithMetadataAtEachElement:
397
400
  - Value: 1
398
401
  Metadata: # describe this specific value "1" with Metadata here
@@ -403,7 +406,7 @@ SameValueListWithMetadataAtEachElement:
403
406
  or assign Metadata to both the list and any of its list entries, like this:
404
407
 
405
408
  ```yaml
406
- ValueListWithoutMetadata: [1,2,3]
409
+ ValueListWithoutMetadata: [ 1,2,3 ]
407
410
  SameValueListWithAllMetadata:
408
411
  Metadata: # Recommendation: place the Metadata of the list first if the list of values is extensive, as in this case
409
412
  Values:
@@ -464,6 +467,7 @@ SameListOfNestedItemsWithGeneralMetadata:
464
467
  Again, you may apply both variants and apply Metadata to the list and each of its items if you wish.
465
468
 
466
469
  #### Contracts
470
+
467
471
  Specifies all Contracts, i.e. repetitive bilateral transactions in between agents.
468
472
  Contracts are given as a list.
469
473
  We recommend moving Contracts to separate files and to use the `!include` command to integrate them in the scenario.
@@ -499,6 +503,7 @@ Contract Parameters:
499
503
  * `Attributes` can be set to include additional information as `int`, `float`, `enum`, or `dict` data types
500
504
 
501
505
  ##### Definition of Multiple Similar Contracts
506
+
502
507
  Often, scenarios contain multiple agents of similar type that also have similar chains of contracts.
503
508
  Therefore, FAME-Io supports a compact definition of multiple similar contracts.
504
509
  `SenderId` and `ReceiverId` can both be lists and support One-to-N, N-to-One and N-to-N relations like in the following
@@ -607,7 +612,8 @@ These CSV files follow a specific structure:
607
612
 
608
613
  * They should contain exactly two columns - any other columns are ignored.
609
614
  A warning is raised if more than two non-empty columns are detected.
610
- * The first column must be a time stamp in form `YYYY-MM-DD_hh:mm:ss`
615
+ * The first column must be a time stamp in form `YYYY-MM-DD_hh:mm:ss` or
616
+ a [FAME-Timestamp](https://gitlab.com/fame-framework/wiki/-/wikis/architecture/decisions/TimeStamp) integer value
611
617
  * The second column must be a numerical value (either integer or floating-point)
612
618
  * The separator of the two columns is a semicolon
613
619
  * The data must **not** have headers, except for comments marked with `#`
@@ -625,6 +631,8 @@ Exemplary content of a valid CSV file:
625
631
 
626
632
  Please refer also to the detailed article about `TimeStamps` in
627
633
  the [FAME-Wiki](https://gitlab.com/fame-framework/wiki/-/wikis/TimeStamp).
634
+ For large CSV files (with more than 20,000 rows) we recommend using the integer representation of FAME-Timestamps in the
635
+ first column (instead of text representation) to improve conversion speed.
628
636
 
629
637
  ### Split and join multiple YAML files
630
638
 
@@ -833,12 +841,12 @@ The option `--merge-times` requires exactly three integer arguments separated by
833
841
  | Second | Steps before | Range of TimeSteps before the `focal-point` they get merged to, must be Zero or positive |
834
842
  | Third | Steps after | Range of TimeSteps after the `focal-point` they get merged to, must be Zero or positive |
835
843
 
836
-
837
844
  This could look as follows:
838
845
 
839
846
  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
840
847
 
841
- Make sure that in the range of time steps you specify for merging, there is only one value per column in the merged time range.
848
+ Make sure that in the range of time steps you specify for merging, there is only one value per column in the merged time
849
+ range.
842
850
  If multiple values per column are merged values will get concatenated and might yield unexpected results.
843
851
 
844
852
  You may also call the conversion script from any Python script with:
@@ -7,7 +7,7 @@ build-backend = "poetry.core.masonry.api"
7
7
 
8
8
  [tool.poetry]
9
9
  name = "fameio"
10
- version = "3.0.0"
10
+ version = "3.1.0"
11
11
  description = "Tools for input preparation and output digestion of FAME models"
12
12
  license = "Apache-2.0"
13
13
  authors = [
@@ -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 = data.apply(
105
- lambda r: [FameTime.convert_string_if_is_datetime(r[0]), self._assert_valid(r[1])],
106
- axis=1,
107
- result_type="expand",
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:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes