eido 0.2.3__tar.gz → 0.2.5__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 (32) hide show
  1. {eido-0.2.3/eido.egg-info → eido-0.2.5}/PKG-INFO +14 -4
  2. eido-0.2.5/eido/_version.py +1 -0
  3. {eido-0.2.3 → eido-0.2.5}/eido/conversion.py +1 -2
  4. {eido-0.2.3 → eido-0.2.5}/eido/conversion_plugins.py +3 -4
  5. {eido-0.2.3 → eido-0.2.5}/eido/exceptions.py +1 -1
  6. {eido-0.2.3 → eido-0.2.5}/eido/output_formatters.py +1 -1
  7. {eido-0.2.3 → eido-0.2.5}/eido/validation.py +9 -5
  8. {eido-0.2.3 → eido-0.2.5/eido.egg-info}/PKG-INFO +14 -4
  9. {eido-0.2.3 → eido-0.2.5}/eido.egg-info/requires.txt +2 -2
  10. {eido-0.2.3 → eido-0.2.5}/requirements/requirements-all.txt +2 -2
  11. {eido-0.2.3 → eido-0.2.5}/tests/test_conversions.py +31 -1
  12. {eido-0.2.3 → eido-0.2.5}/tests/test_validations.py +9 -4
  13. eido-0.2.3/eido/_version.py +0 -1
  14. {eido-0.2.3 → eido-0.2.5}/LICENSE.txt +0 -0
  15. {eido-0.2.3 → eido-0.2.5}/MANIFEST.in +0 -0
  16. {eido-0.2.3 → eido-0.2.5}/README.md +0 -0
  17. {eido-0.2.3 → eido-0.2.5}/eido/__init__.py +0 -0
  18. {eido-0.2.3 → eido-0.2.5}/eido/__main__.py +0 -0
  19. {eido-0.2.3 → eido-0.2.5}/eido/argparser.py +0 -0
  20. {eido-0.2.3 → eido-0.2.5}/eido/cli.py +0 -0
  21. {eido-0.2.3 → eido-0.2.5}/eido/const.py +0 -0
  22. {eido-0.2.3 → eido-0.2.5}/eido/inspection.py +0 -0
  23. {eido-0.2.3 → eido-0.2.5}/eido/schema.py +0 -0
  24. {eido-0.2.3 → eido-0.2.5}/eido.egg-info/SOURCES.txt +0 -0
  25. {eido-0.2.3 → eido-0.2.5}/eido.egg-info/dependency_links.txt +0 -0
  26. {eido-0.2.3 → eido-0.2.5}/eido.egg-info/entry_points.txt +0 -0
  27. {eido-0.2.3 → eido-0.2.5}/eido.egg-info/top_level.txt +0 -0
  28. {eido-0.2.3 → eido-0.2.5}/requirements/requirements-doc.txt +0 -0
  29. {eido-0.2.3 → eido-0.2.5}/requirements/requirements-test.txt +0 -0
  30. {eido-0.2.3 → eido-0.2.5}/setup.cfg +0 -0
  31. {eido-0.2.3 → eido-0.2.5}/setup.py +0 -0
  32. {eido-0.2.3 → eido-0.2.5}/tests/test_schema_operations.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: eido
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A project metadata validator
5
5
  Home-page: https://github.com/pepkit/eido/
6
6
  Author: Michal Stolarczyk, Nathan Sheffield
@@ -18,9 +18,19 @@ License-File: LICENSE.txt
18
18
  Requires-Dist: importlib-metadata; python_version < "3.10"
19
19
  Requires-Dist: jsonschema>=3.0.1
20
20
  Requires-Dist: logmuse>=0.2.5
21
- Requires-Dist: pandas
22
- Requires-Dist: peppy>=0.40.6
21
+ Requires-Dist: pandas<3.0.0
22
+ Requires-Dist: peppy>=0.40.7
23
23
  Requires-Dist: ubiquerg>=0.5.2
24
+ Dynamic: author
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: home-page
29
+ Dynamic: keywords
30
+ Dynamic: license
31
+ Dynamic: license-file
32
+ Dynamic: requires-dist
33
+ Dynamic: summary
24
34
 
25
35
  # <img src="docs/img/eido.svg" alt="eido logo" height="70">
26
36
 
@@ -0,0 +1 @@
1
+ __version__ = "0.2.5"
@@ -7,7 +7,6 @@ else:
7
7
  import inspect
8
8
  from logging import getLogger
9
9
  import os
10
- from typing import NoReturn
11
10
 
12
11
  from .exceptions import *
13
12
 
@@ -107,7 +106,7 @@ def run_filter(prj, filter_name, verbose=True, plugin_kwargs=None):
107
106
  return conv_result
108
107
 
109
108
 
110
- def save_result(result_path: str, content: str) -> NoReturn:
109
+ def save_result(result_path: str, content: str) -> None:
111
110
  with open(result_path, "w") as f:
112
111
  f.write(content)
113
112
 
@@ -1,4 +1,4 @@
1
- """ built-in PEP filters """
1
+ """built-in PEP filters"""
2
2
 
3
3
  from typing import Dict
4
4
  from .output_formatters import MultilineOutputFormatter
@@ -42,8 +42,7 @@ def yaml_pep_filter(p, **kwargs) -> Dict[str, str]:
42
42
  """
43
43
  from yaml import dump
44
44
 
45
- data = p.config.to_dict()
46
- return {"project": dump(data, default_flow_style=False)}
45
+ return {"project": dump(p.config, default_flow_style=False)}
47
46
 
48
47
 
49
48
  def csv_pep_filter(p, **kwargs) -> Dict[str, str]:
@@ -70,7 +69,7 @@ def processed_pep_filter(p, **kwargs) -> Dict[str, str]:
70
69
  samples_as_objects = kwargs.get("samples_as_objects")
71
70
  subsamples_as_objects = kwargs.get("subsamples_as_objects")
72
71
 
73
- prj_repr = p.config.to_dict()
72
+ prj_repr = p.config
74
73
 
75
74
  return {
76
75
  "project": str(prj_repr),
@@ -1,4 +1,4 @@
1
- """ Exceptions for specific eido issues. """
1
+ """Exceptions for specific eido issues."""
2
2
 
3
3
  from abc import ABCMeta
4
4
 
@@ -110,7 +110,7 @@ class MultilineOutputFormatter(BaseOutputFormatter):
110
110
  ):
111
111
  value = sample[attribute][sample_index]
112
112
  else:
113
- value = sample[attribute]
113
+ value = sample.get(attribute)
114
114
 
115
115
  sample_row.append(value or "")
116
116
 
@@ -1,5 +1,5 @@
1
1
  import os
2
- from typing import NoReturn, Mapping, Union
2
+ from typing import Mapping, Union
3
3
  from copy import deepcopy as dpcpy
4
4
  from logging import getLogger
5
5
 
@@ -43,6 +43,10 @@ def _validate_object(obj: Mapping, schema: Union[str, dict], sample_name_colname
43
43
  instance_name = error.instance[sample_name_colname]
44
44
  except KeyError:
45
45
  instance_name = "project"
46
+ except TypeError:
47
+ instance_name = obj["samples"][error.absolute_path[1]][
48
+ sample_name_colname
49
+ ]
46
50
  errors_by_type[error.message].append(
47
51
  {
48
52
  "type": error.message,
@@ -56,7 +60,7 @@ def _validate_object(obj: Mapping, schema: Union[str, dict], sample_name_colname
56
60
  _LOGGER.debug("Validation was successful...")
57
61
 
58
62
 
59
- def validate_project(project: peppy.Project, schema: Union[str, dict]) -> NoReturn:
63
+ def validate_project(project: peppy.Project, schema: Union[str, dict]) -> None:
60
64
  """
61
65
  Validate a project object against a schema
62
66
 
@@ -64,7 +68,7 @@ def validate_project(project: peppy.Project, schema: Union[str, dict]) -> NoRetu
64
68
  :param str | dict schema: schema dict to validate against or a path to one
65
69
  from the error. Useful when used ith large projects
66
70
 
67
- :return: NoReturn
71
+ :return: None
68
72
  :raises EidoValidationError: if validation is unsuccessful
69
73
  """
70
74
  sample_name_colname = project.sample_name_colname
@@ -96,7 +100,7 @@ def _validate_sample_object(sample: peppy.Sample, schemas):
96
100
 
97
101
  def validate_sample(
98
102
  project: peppy.Project, sample_name: Union[str, int], schema: Union[str, dict]
99
- ) -> NoReturn:
103
+ ) -> None:
100
104
  """
101
105
  Validate the selected sample object against a schema
102
106
 
@@ -119,7 +123,7 @@ def validate_sample(
119
123
 
120
124
  def validate_config(
121
125
  project: Union[peppy.Project, dict], schema: Union[str, dict]
122
- ) -> NoReturn:
126
+ ) -> None:
123
127
  """
124
128
  Validate the config part of the Project object against a schema
125
129
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: eido
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A project metadata validator
5
5
  Home-page: https://github.com/pepkit/eido/
6
6
  Author: Michal Stolarczyk, Nathan Sheffield
@@ -18,9 +18,19 @@ License-File: LICENSE.txt
18
18
  Requires-Dist: importlib-metadata; python_version < "3.10"
19
19
  Requires-Dist: jsonschema>=3.0.1
20
20
  Requires-Dist: logmuse>=0.2.5
21
- Requires-Dist: pandas
22
- Requires-Dist: peppy>=0.40.6
21
+ Requires-Dist: pandas<3.0.0
22
+ Requires-Dist: peppy>=0.40.7
23
23
  Requires-Dist: ubiquerg>=0.5.2
24
+ Dynamic: author
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: home-page
29
+ Dynamic: keywords
30
+ Dynamic: license
31
+ Dynamic: license-file
32
+ Dynamic: requires-dist
33
+ Dynamic: summary
24
34
 
25
35
  # <img src="docs/img/eido.svg" alt="eido logo" height="70">
26
36
 
@@ -1,7 +1,7 @@
1
1
  jsonschema>=3.0.1
2
2
  logmuse>=0.2.5
3
- pandas
4
- peppy>=0.40.6
3
+ pandas<3.0.0
4
+ peppy>=0.40.7
5
5
  ubiquerg>=0.5.2
6
6
 
7
7
  [:python_version < "3.10"]
@@ -1,6 +1,6 @@
1
1
  importlib-metadata; python_version < '3.10'
2
2
  jsonschema>=3.0.1
3
3
  logmuse>=0.2.5
4
- pandas
5
- peppy>=0.40.6
4
+ pandas<3.0.0
5
+ peppy>=0.40.7
6
6
  ubiquerg>=0.5.2
@@ -1,4 +1,10 @@
1
- from eido.conversion import *
1
+ from eido.conversion import (
2
+ run_filter,
3
+ get_available_pep_filters,
4
+ pep_conversion_plugins,
5
+ convert_project,
6
+ )
7
+ import peppy
2
8
 
3
9
 
4
10
  class TestConversionInfrastructure:
@@ -74,3 +80,27 @@ class TestConversionInfrastructure:
74
80
 
75
81
  assert save_result_mock.called
76
82
  assert conv_result == {"samples": output_pep_nextflow_taxprofiler}
83
+
84
+ def test_multiple_subsamples(self, test_multiple_subs):
85
+ project = peppy.Project(test_multiple_subs, sample_table_index="sample_id")
86
+
87
+ conversion = convert_project(
88
+ project,
89
+ "csv",
90
+ )
91
+ assert isinstance(conversion["samples"], str)
92
+ conversion = convert_project(
93
+ project,
94
+ "basic",
95
+ )
96
+ assert isinstance(conversion["project"], str)
97
+ conversion = convert_project(
98
+ project,
99
+ "yaml",
100
+ )
101
+ assert isinstance(conversion["project"], str)
102
+ conversion = convert_project(
103
+ project,
104
+ "yaml-samples",
105
+ )
106
+ assert isinstance(conversion["samples"], str)
@@ -1,7 +1,6 @@
1
1
  import urllib
2
2
 
3
3
  import pytest
4
- from jsonschema.exceptions import ValidationError
5
4
  from peppy import Project
6
5
  from peppy.utils import load_yaml
7
6
 
@@ -140,9 +139,15 @@ class TestProjectWithoutConfigValidation:
140
139
  )
141
140
 
142
141
  def test_validate_file_existance(
143
- self, test_file_existance_pep, test_file_existence_schema
142
+ self, test_file_existing_pep, test_file_existing_schema
144
143
  ):
145
- schema_path = test_file_existence_schema
146
- prj = Project(test_file_existance_pep)
144
+ schema_path = test_file_existing_schema
145
+ prj = Project(test_file_existing_pep)
147
146
  with pytest.raises(PathAttrNotFoundError):
148
147
  validate_input_files(prj, schema_path)
148
+
149
+ def test_validation_values(self, test_schema_value_check, test_file_value_check):
150
+ schema_path = test_schema_value_check
151
+ prj = Project(test_file_value_check)
152
+ with pytest.raises(EidoValidationError):
153
+ validate_project(project=prj, schema=schema_path)
@@ -1 +0,0 @@
1
- __version__ = "0.2.3"
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
File without changes
File without changes
File without changes
File without changes