Skip to content

Commit cb9221f

Browse files
authored
Merge pull request #174 from BIH-CEI/156-add-util-method-that-loads-data-in-whatever-format-and-provides-an-iterator-for-instances
156 add util method that loads data in whatever format and provides an iterator for instances
2 parents f7471b4 + 55ad3f1 commit cb9221f

20 files changed

+311
-181
lines changed

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ classifiers = [
2727
"Topic :: Scientific/Engineering :: Machine Learning"
2828
]
2929
dependencies = [
30-
"loguru", "phenopackets", "pandas", "openpyxl", "jupyter", "requests", "bs4",
30+
"loguru",
31+
"phenopackets",
32+
"pandas",
33+
"openpyxl",
34+
"jupyter",
35+
"requests",
36+
"bs4",
37+
"xmltodict==0.14.1",
3138
]
3239
dynamic = ["version"]
3340

src/phenopacket_mapper/__init__.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22

33
__version__ = "0.0.1"
44

5-
from . import cli, data_standards, pipeline, preprocessing, api_requests
5+
from . import data_standards, validate, preprocessing, api_requests, mapping, utils
66

7-
from .pipeline import PhenopacketMapper
7+
from .data_standards import DataModel
8+
from .mapping import PhenopacketMapper
89

9-
__all__ = ["cli", "data_standards", "pipeline", "PhenopacketMapper", "preprocessing", "api_requests"]
10+
__all__ = [
11+
"data_standards", "DataModel",
12+
"validate",
13+
"preprocessing",
14+
"api_requests",
15+
"mapping", "PhenopacketMapper",
16+
"utils",
17+
]

src/phenopacket_mapper/cli/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/phenopacket_mapper/cli/main.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/phenopacket_mapper/cli/mapping_command.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/phenopacket_mapper/cli/quickstart_command.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/phenopacket_mapper/cli/validate_command.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/phenopacket_mapper/data_standards/data_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ def load_data(
256256
:param kwargs: Dynamically passed parameters that match {id}_column for each item
257257
:return: A list of `DataModelInstance` objects
258258
"""
259+
# TODO: move the dynamic params to the load method in utils.io
259260
column_names = dict()
260261
for f in self.fields:
261262
column_param = f"{f.id}_column"
@@ -264,7 +265,7 @@ def load_data(
264265
else:
265266
column_names[f.id] = kwargs[column_param]
266267

267-
from phenopacket_mapper.pipeline import load_data_using_data_model
268+
from phenopacket_mapper.utils.io import load_data_using_data_model
268269
return load_data_using_data_model(
269270
path=path,
270271
data_model=self,

src/phenopacket_mapper/pipeline/__init__.py

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""This module handles the input and output of data."""
2+
3+
from .read_json import read_json
4+
from .read_xml import read_xml, parse_xml
5+
from .data_reader import DataReader
6+
from .input import read_data_model, read_phenopackets, read_phenopacket_from_json, load_data_using_data_model
7+
from .output import write
8+
9+
__all__ = [
10+
'read_json',
11+
'read_xml', 'parse_xml',
12+
'DataReader',
13+
'read_data_model',
14+
'read_phenopackets',
15+
'read_phenopacket_from_json',
16+
'load_data_using_data_model',
17+
18+
'write',
19+
]

0 commit comments

Comments
 (0)