tsdf 0.5.2__tar.gz → 0.6.1__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.
@@ -1,19 +1,18 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: tsdf
3
- Version: 0.5.2
3
+ Version: 0.6.1
4
4
  Summary: A Python library that provides methods for encoding and decoding TSDF (Time Series Data Format) data, which allows you to easily create, manipulate and serialize TSDF files in your Python code.
5
- Home-page: https://github.com/biomarkersParkinson/tsdf
6
5
  License: Apache-2.0
6
+ License-File: LICENSE
7
7
  Keywords: Time Series Data Format (TSDF),binary data,digital sensors
8
- Author: Peter Kok
9
- Author-email: p.kok@esciencecenter.nl
10
- Requires-Python: >=3.9,<4.0
8
+ Author: Vedran Kasalica
9
+ Author-email: v.kaslica@esciencecenter.nl
10
+ Requires-Python: >=3.11,<3.13
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Programming Language :: Python
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
14
  Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
17
16
  Requires-Dist: numpy (>=1.24.1,<2.0.0)
18
17
  Requires-Dist: pandas (>=2.1.3,<3.0.0)
19
18
  Project-URL: Repository, https://github.com/biomarkersParkinson/tsdf
@@ -25,7 +24,7 @@ Description-Content-Type: text/markdown
25
24
  | Badges | |
26
25
  |:----:|----|
27
26
  | **Packages and Releases** | [![Latest release](https://img.shields.io/github/release/biomarkersparkinson/tsdf.svg)](https://github.com/biomarkersparkinson/tsdf/releases/latest) [![PyPI](https://img.shields.io/pypi/v/tsdf.svg)](https://pypi.python.org/pypi/tsdf/) [![Static Badge](https://img.shields.io/badge/RSD-tsdf-lib)](https://research-software-directory.org/software/tsdf) |
28
- | **Build Status** | [![](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/) ![Python package](https://github.com/biomarkersparkinson/tsdf/workflows/Python%20package/badge.svg) |
27
+ | **Build Status** | [![](https://img.shields.io/badge/python-3.11%2C3.12-blue.svg)](https://www.python.org/downloads/) ![Build and test](https://github.com/biomarkersparkinson/tsdf/workflows/build-and-test.yml/badge.svg) |
29
28
  | **DOI** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7867899.svg)](https://doi.org/10.5281/zenodo.7867899) |
30
29
  | **License** | [![GitHub license](https://img.shields.io/github/license/biomarkersParkinson/tsdf)](https://github.com/biomarkersparkinson/tsdf/blob/main/LICENSE) |
31
30
  | **Fairness** | [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8083/badge)](https://www.bestpractices.dev/projects/8083) |
@@ -34,11 +33,16 @@ Description-Content-Type: text/markdown
34
33
 
35
34
  A package ([documentation](https://biomarkersparkinson.github.io/tsdf/)) to load TSDF data ([specification](https://arxiv.org/abs/2211.11294)) into Python.
36
35
 
36
+ ## Overview
37
+ The [tsdf package](10.5281/zenodo.7867899) is a comprehensively documented reference implementation of the Time Series Data Format (TSDF) standard [[1]](https://arxiv.org/abs/2211.11294). TSDF simplifies data storage and exchange of multi-channel digital sensor data, thereby promoting interpretability and reproducibility of scientific results. Sensor measurements and timestamps are stored as raw tabular binary array files. To ensure unambiguous reconstruction, binary array files are accompanied by human-readable JavaScript Object Notation (JSON) metadata files, which contain a set of mandatory fields limited to essential sensor measurement information.
38
+
39
+ The tsdf Python package implements functions for reading and writing TSDF files. It guarantees formatting and metadata consistency. It enforces usage of the essential metadata such as study identification, time frame, data channel descriptions and data attributes corresponding to the binary data.
40
+
37
41
  ## Installation
38
42
 
39
43
  ### Using `pip`
40
44
 
41
- The package is available in PyPi and requires [Python 3.9](https://www.python.org/downloads/) or higher. It can be installed using:
45
+ The package is available in PyPi and requires [Python 3.11](https://www.python.org/downloads/) or higher. It can be installed using:
42
46
 
43
47
  ```bash
44
48
  $ pip install tsdf
@@ -59,17 +63,19 @@ poetry run pytest
59
63
 
60
64
  ### Building the documentation
61
65
 
62
- We use [mkdocs](https://www.mkdocs.org/) to build the documentation. If you want to build the documentation locally, the following commands will prove useful:
66
+ We use [Sphinx](https://www.sphinx-doc.org/) to build the documentation. Use this command to build the documentation locally:
63
67
 
64
68
  ```bash
65
- mkdocs build # build the documentation
66
- mkdocs serve # serve the documentation on a local server
67
- mkdocs gh-deploy # deploy the documentation to GitHub pages
69
+ poetry run make html --directory docs
68
70
  ```
69
71
 
70
72
  ## Contributing
71
73
 
72
- Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
74
+ We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details on coding standards, how to get started, and the submission process.
75
+
76
+ ## Code of Conduct
77
+
78
+ To ensure a welcoming and respectful community, all contributors and participants are expected to adhere to our [Code of Conduct](CONDUCT.md). By participating in this project, you agree to abide by its terms.
73
79
 
74
80
  ## License
75
81
 
@@ -4,7 +4,7 @@
4
4
  | Badges | |
5
5
  |:----:|----|
6
6
  | **Packages and Releases** | [![Latest release](https://img.shields.io/github/release/biomarkersparkinson/tsdf.svg)](https://github.com/biomarkersparkinson/tsdf/releases/latest) [![PyPI](https://img.shields.io/pypi/v/tsdf.svg)](https://pypi.python.org/pypi/tsdf/) [![Static Badge](https://img.shields.io/badge/RSD-tsdf-lib)](https://research-software-directory.org/software/tsdf) |
7
- | **Build Status** | [![](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/) ![Python package](https://github.com/biomarkersparkinson/tsdf/workflows/Python%20package/badge.svg) |
7
+ | **Build Status** | [![](https://img.shields.io/badge/python-3.11%2C3.12-blue.svg)](https://www.python.org/downloads/) ![Build and test](https://github.com/biomarkersparkinson/tsdf/workflows/build-and-test.yml/badge.svg) |
8
8
  | **DOI** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7867899.svg)](https://doi.org/10.5281/zenodo.7867899) |
9
9
  | **License** | [![GitHub license](https://img.shields.io/github/license/biomarkersParkinson/tsdf)](https://github.com/biomarkersparkinson/tsdf/blob/main/LICENSE) |
10
10
  | **Fairness** | [![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/8083/badge)](https://www.bestpractices.dev/projects/8083) |
@@ -13,11 +13,16 @@
13
13
 
14
14
  A package ([documentation](https://biomarkersparkinson.github.io/tsdf/)) to load TSDF data ([specification](https://arxiv.org/abs/2211.11294)) into Python.
15
15
 
16
+ ## Overview
17
+ The [tsdf package](10.5281/zenodo.7867899) is a comprehensively documented reference implementation of the Time Series Data Format (TSDF) standard [[1]](https://arxiv.org/abs/2211.11294). TSDF simplifies data storage and exchange of multi-channel digital sensor data, thereby promoting interpretability and reproducibility of scientific results. Sensor measurements and timestamps are stored as raw tabular binary array files. To ensure unambiguous reconstruction, binary array files are accompanied by human-readable JavaScript Object Notation (JSON) metadata files, which contain a set of mandatory fields limited to essential sensor measurement information.
18
+
19
+ The tsdf Python package implements functions for reading and writing TSDF files. It guarantees formatting and metadata consistency. It enforces usage of the essential metadata such as study identification, time frame, data channel descriptions and data attributes corresponding to the binary data.
20
+
16
21
  ## Installation
17
22
 
18
23
  ### Using `pip`
19
24
 
20
- The package is available in PyPi and requires [Python 3.9](https://www.python.org/downloads/) or higher. It can be installed using:
25
+ The package is available in PyPi and requires [Python 3.11](https://www.python.org/downloads/) or higher. It can be installed using:
21
26
 
22
27
  ```bash
23
28
  $ pip install tsdf
@@ -38,17 +43,19 @@ poetry run pytest
38
43
 
39
44
  ### Building the documentation
40
45
 
41
- We use [mkdocs](https://www.mkdocs.org/) to build the documentation. If you want to build the documentation locally, the following commands will prove useful:
46
+ We use [Sphinx](https://www.sphinx-doc.org/) to build the documentation. Use this command to build the documentation locally:
42
47
 
43
48
  ```bash
44
- mkdocs build # build the documentation
45
- mkdocs serve # serve the documentation on a local server
46
- mkdocs gh-deploy # deploy the documentation to GitHub pages
49
+ poetry run make html --directory docs
47
50
  ```
48
51
 
49
52
  ## Contributing
50
53
 
51
- Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
54
+ We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details on coding standards, how to get started, and the submission process.
55
+
56
+ ## Code of Conduct
57
+
58
+ To ensure a welcoming and respectful community, all contributors and participants are expected to adhere to our [Code of Conduct](CONDUCT.md). By participating in this project, you agree to abide by its terms.
52
59
 
53
60
  ## License
54
61
 
@@ -1,10 +1,15 @@
1
1
  [tool.poetry]
2
2
  name = "tsdf"
3
- version = "0.5.2"
3
+ version = "0.6.1"
4
4
  description = "A Python library that provides methods for encoding and decoding TSDF (Time Series Data Format) data, which allows you to easily create, manipulate and serialize TSDF files in your Python code."
5
- authors = ["Peter Kok <p.kok@esciencecenter.nl>",
6
- "Pablo Rodríguez <p.rodriguez-sanchez@esciencecenter.nl>",
7
- "Vedran Kasalica <v.kaslica@esciencecenter.nl>"]
5
+ authors = ["Vedran Kasalica <v.kaslica@esciencecenter.nl>",
6
+ "Pablo Rodríguez <p.rodriguez-sanchez@esciencecenter.nl>",
7
+ "Luc Evers <luc.evers@radboudumc.nl>",
8
+ "Erik Post <erik.post@radboudumc.nl>",
9
+ "Yordan Raykov <yordan.raykov@nottingham.ac.uk>",
10
+ "Max Little <maxl@mit.edu>",
11
+ "Peter Kok <p.kok@esciencecenter.nl>",
12
+ ]
8
13
  license = "Apache-2.0"
9
14
  classifiers = [
10
15
  "License :: OSI Approved :: Apache Software License",
@@ -16,23 +21,31 @@ keywords = ["Time Series Data Format (TSDF)", "binary data", "digital sensors"]
16
21
  repository = "https://github.com/biomarkersParkinson/tsdf"
17
22
 
18
23
  [tool.poetry.dependencies]
19
- python = "^3.9"
24
+ python = ">=3.11,<3.13"
20
25
  numpy = "^1.24.1"
21
26
  pandas = "^2.1.3"
22
27
 
23
28
  [tool.poetry.group.dev.dependencies]
29
+ coverage = "^7.0.0"
30
+ matplotlib = "^3.6.3"
31
+ pytype = "^2024.4.11"
32
+ myst-parser = "^3.0.1"
33
+
34
+ [tool.poetry.group.testing.dependencies]
35
+ ipykernel = "^6.19.2"
24
36
  pytest = "^7.2.0"
25
37
  pytest-cov = "^4.0.0"
26
38
  pytest-datadir = "^1.4.1"
27
- jupyter = "^1.0.0"
28
- ipykernel = "^6.19.2"
29
- coverage = "^7.0.0"
30
- matplotlib = "^3.6.3"
31
- mkdocs = "^1.4.2"
32
- mkdocs-jupyter = "^0.22.0"
39
+
40
+ [tool.poetry.group.docs.dependencies]
41
+ sphinx = "^7.3.7"
42
+ myst-nb = "^1.1.0"
43
+ sphinx-autoapi = "^3.1.2"
44
+ sphinx-rtd-theme = "^2.0.0"
33
45
 
34
46
  [tool.poetry.scripts]
35
47
  validate-tsdf = "tsdf.validator:main"
48
+ #docs = "sphinx.cmd.build:main"
36
49
 
37
50
  [build-system]
38
51
  requires = ["poetry-core>=1.0.0"]
@@ -6,6 +6,8 @@ Reference: https://arxiv.org/abs/2211.11294
6
6
 
7
7
  import os
8
8
  from typing import Any, Dict, List
9
+ import re
10
+ from dateutil import parser
9
11
 
10
12
  from tsdf import constants
11
13
  from tsdf import tsdfmetadata
@@ -82,7 +84,7 @@ def _read_struct(
82
84
  # levels of the TSDF structure.
83
85
  # Extend the mapping recursively with values provided at those levels.
84
86
  for key, value in remaining_data.items():
85
- if _is_a_list(value):
87
+ if isinstance(value, list):
86
88
  for each_value in value:
87
89
  all_streams = all_streams | _read_struct(
88
90
  each_value, defined_properties.copy(), source_path, version
@@ -135,17 +137,6 @@ def _contains_file_name(data: Any) -> bool:
135
137
  return False
136
138
 
137
139
 
138
- def _is_a_list(value) -> bool:
139
- """
140
- Function returns True if the value is a list, otherwise it returns False.
141
-
142
- :param value: value to be checked.
143
-
144
- :return: True if the value is a list, otherwise False.
145
- """
146
- return isinstance(value, list)
147
-
148
-
149
140
  def contains_tsdf_mandatory_fields(dictionary: Dict[str, Any]) -> bool:
150
141
  """
151
142
  Verifies that all the mandatory properties for TSDF metadata are provided,
@@ -242,4 +233,33 @@ def confirm_dir_of_metadata(metadatas: List["tsdfmetadata.TSDFMetadata"]) -> Non
242
233
  if init_metadata.file_name == curr_metadata.file_name:
243
234
  raise tsdfmetadata.TSDFMetadataFieldValueError(
244
235
  "Two metadata objects cannot reference the same binary file (file_name)."
236
+ #TODO: why not?
245
237
  )
238
+
239
+ def is_iso8601(date_string: str) -> bool:
240
+ """
241
+ Checks if the given date string is in ISO8601 format.
242
+
243
+ :param date_string: date string to be checked.
244
+ """
245
+ # Note that we need both the regex and the parser to validate the date string
246
+ # The regex only still allows for invalid dates, e.g. 2021-02-29
247
+ # The parser is too lenient in accepting different formats
248
+ iso8601_regex = r"^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])(T(2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?)?$"
249
+ if re.match(iso8601_regex, date_string):
250
+ try:
251
+ parser.parse(date_string)
252
+ return True
253
+ except tsdfmetadata.TSDFMetadataFieldValueError:
254
+ return False
255
+ return False
256
+
257
+ def validate_datetimes(metadata: tsdfmetadata.TSDFMetadata) -> bool:
258
+ """
259
+ Validates the start and end date format of the TSDFMetaData object.
260
+ """
261
+ if not is_iso8601(metadata.start_iso8601):
262
+ raise tsdfmetadata.TSDFMetadataFieldValueError(f"Invalid start_iso8601: {metadata.start_iso8601}")
263
+ if not is_iso8601(metadata.end_iso8601):
264
+ raise tsdfmetadata.TSDFMetadataFieldValueError(f"Invalid end_iso8601: {metadata.end_iso8601}")
265
+ return True
@@ -6,6 +6,7 @@ Reference: https://arxiv.org/abs/2211.11294
6
6
 
7
7
  import json
8
8
  import os
9
+ from pathlib import Path
9
10
  from typing import Dict, List
10
11
  from tsdf import file_utils
11
12
  from tsdf.constants import METADATA_NAMING_PATTERN
@@ -71,7 +72,7 @@ def load_metadatas_from_dir(
71
72
  return metadatas
72
73
 
73
74
 
74
- def load_metadata_from_path(path: str) -> Dict[str, TSDFMetadata]:
75
+ def load_metadata_from_path(path: Path) -> Dict[str, TSDFMetadata]:
75
76
  """
76
77
  Loads a TSDF metadata file, returns a dictionary
77
78
 
@@ -1,5 +1,7 @@
1
1
  import copy
2
2
  from typing import Any, Dict, List
3
+ from datetime import datetime
4
+ from dateutil import parser
3
5
 
4
6
  from tsdf import parse_metadata
5
7
 
@@ -48,11 +50,11 @@ class TSDFMetadata:
48
50
 
49
51
  file_dir_path: str
50
52
  """ A reference to the directory path, so we don't need it again when reading associated binary files. """
51
- metadata_file_name: str
53
+ metadata_file_name: str #TODO: do we need this?? / is it used?
52
54
  """ A reference to the source path, so we don't need it again when reading associated binary files. """
53
55
 
54
56
  def __init__(
55
- self, dictionary: Dict[str, Any], dir_path: str, metadata_file_name: str = ""
57
+ self, dictionary: Dict[str, Any], dir_path: str, metadata_file_name: str = "", do_validate: bool = True
56
58
  ) -> None:
57
59
  """
58
60
  The default constructor takes a dictionary as an argument and creates each
@@ -61,14 +63,34 @@ class TSDFMetadata:
61
63
 
62
64
  :param dictionary: dictionary containing TSDF metadata.
63
65
  :param dir_path: path to the directory where the metadata file is stored.
64
- :param file_name: (optional) name of the metadata file.
66
+ :param metadata_file_name: (optional) name of the metadata file.
67
+ :param do_validate: (optional) flag to validate the metadata.
65
68
  """
66
- parse_metadata.contains_tsdf_mandatory_fields(dictionary) #TODO: how to load a dict that is not complete yet?
69
+
70
+ # Copy the attributes from the dictionary to the object
67
71
  for key, value in dictionary.items():
68
72
  setattr(self, key, value)
69
73
  self.file_dir_path = dir_path
70
74
  self.metadata_file_name = metadata_file_name
71
75
 
76
+ # Validate the metadata
77
+ if do_validate:
78
+ if not self.validate():
79
+ raise TSDFMetadataFieldValueError("The provided metadata is invalid.")
80
+
81
+
82
+ def validate(self) -> bool:
83
+ isValid: bool = True
84
+
85
+ # Validate presence of mandatory fields
86
+ dict = self.get_plain_tsdf_dict_copy()
87
+ isValid = isValid and parse_metadata.contains_tsdf_mandatory_fields(dict)
88
+
89
+ # Validate datetimes
90
+ isValid = isValid and parse_metadata.validate_datetimes(self)
91
+
92
+ return isValid
93
+
72
94
  def get_plain_tsdf_dict_copy(self) -> Dict[str, Any]:
73
95
  """
74
96
  Method returns the a copy of the dict containing fields needed for the TSDF file.
@@ -81,3 +103,41 @@ class TSDFMetadata:
81
103
  if simple_dict.get("metadata_file_name") is not None:
82
104
  simple_dict.pop("metadata_file_name")
83
105
  return simple_dict
106
+
107
+ def set_start_datetime(self, date_time: datetime) -> None:
108
+ """
109
+ Sets the start date of the recording in ISO8601 format.
110
+ :param date_time: datetime object containing the start date.
111
+ """
112
+ self.start_iso8601 = date_time.isoformat()
113
+
114
+ def get_start_datetime(self) -> datetime:
115
+ """
116
+ Returns the start date of the recording as a datetime object.
117
+ :return: datetime object containing the start date.
118
+ """
119
+ return parser.parse(self.start_iso8601)
120
+
121
+ def set_end_datetime(self, date_time: datetime) -> None:
122
+ """
123
+ Sets the end date of the recording in ISO8601 format.
124
+ :param date_time: datetime object containing the end date.
125
+ """
126
+ self.end_iso8601 = date_time.isoformat()
127
+
128
+ def get_end_datetime(self) -> datetime:
129
+ """
130
+ Returns the end date of the recording as a datetime object.
131
+ :return: datetime object containing the end date.
132
+ """
133
+ return parser.parse(self.end_iso8601)
134
+
135
+ start = property(get_start_datetime, set_start_datetime, doc=
136
+ """
137
+ Start time of the recording.
138
+ """)
139
+
140
+ end = property(get_end_datetime, set_end_datetime, doc=
141
+ """
142
+ End time of the recording.
143
+ """)
@@ -5,26 +5,24 @@ Reference: https://arxiv.org/abs/2211.11294
5
5
  """
6
6
 
7
7
  import os
8
- from typing import Any, Dict
8
+ from typing import Any, Dict, List
9
9
  import numpy as np
10
10
  import pandas as pd
11
- from tsdf import numpy_utils
11
+ from tsdf import numpy_utils
12
12
 
13
13
  from tsdf.tsdfmetadata import TSDFMetadata
14
14
 
15
15
 
16
16
  def write_dataframe_to_binaries(
17
- file_dir: str, df: pd.DataFrame, metadatas: [TSDFMetadata]
17
+ file_dir: str, df: pd.DataFrame, metadatas: List[TSDFMetadata]
18
18
  ) -> None:
19
19
  """
20
20
  Save binary file based on the provided pandas DataFrame.
21
21
 
22
- :param file_dir: path to the directory where the file will be saved.
23
- :param file_name: name of the file to be saved.
24
- :param data: pandas DataFrame containing the data.
25
- :param metadata: dictionary containing the metadata.
26
-
27
- :return: TSDFMetadata object.
22
+ :param file_dir: path to the directory where the file will be saved.
23
+ :param df: pandas DataFrame containing the data.
24
+ :param metadatas: list of metadata objects to be saved, also contains
25
+ channels to be retrieved from dataframe.
28
26
  """
29
27
  for metadata in metadatas:
30
28
  file_name = metadata.file_name
@@ -19,6 +19,9 @@ def write_metadata(metadatas: List[TSDFMetadata], file_name: str) -> None:
19
19
 
20
20
  :raises TSDFMetadataFieldValueError: if the metadata files cannot be combined (e.g. they have no common fields) or if the list of TSDFMetadata objects is empty.
21
21
  """
22
+ for meta in metadatas:
23
+ meta.validate()
24
+
22
25
  if len(metadatas) == 0:
23
26
  raise TSDFMetadataFieldValueError(
24
27
  "Metadata cannot be saved, as the list of TSDFMetadata objects is empty."
@@ -42,7 +45,7 @@ def write_metadata(metadatas: List[TSDFMetadata], file_name: str) -> None:
42
45
  )
43
46
 
44
47
  if len(plain_meta) > 0:
45
- overlap["sensors"] = _calculate_ovelaps_rec(plain_meta)
48
+ overlap["sensors"] = _calculate_overlaps_rec(plain_meta)
46
49
  file_utils.write_to_file(overlap, metadatas[0].file_dir_path, file_name)
47
50
 
48
51
 
@@ -76,7 +79,7 @@ def _extract_common_fields(metadatas: List[Dict[str, Any]]) -> Dict[str, Any]:
76
79
  return meta_overlap
77
80
 
78
81
 
79
- def _calculate_ovelaps_rec(metadatas: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
82
+ def _calculate_overlaps_rec(metadatas: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
80
83
  """
81
84
  A recursive call that optimises the structure of the TSDF metadata, by grouping common values. For the input the list of dictionaries
82
85
  corresponds to a list of "flat" metadata dictionaries. The output is a list of dictionaries (potentially of length 1) that contain
@@ -107,11 +110,11 @@ def _calculate_ovelaps_rec(metadatas: List[Dict[str, Any]]) -> List[Dict[str, An
107
110
  # Handle the first group
108
111
  first_overlap = _extract_common_fields(first_group)
109
112
  if len(first_group) > 0:
110
- first_overlap["sensors"] = _calculate_ovelaps_rec(first_group)
113
+ first_overlap["sensors"] = _calculate_overlaps_rec(first_group)
111
114
  final_metadata.append(first_overlap)
112
115
 
113
116
  # Handle the rest of the elements
114
- second_overlap = _calculate_ovelaps_rec(second_grop)
117
+ second_overlap = _calculate_overlaps_rec(second_grop)
115
118
  final_metadata.extend(second_overlap)
116
119
 
117
120
  return final_metadata
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes