eido 0.2.3__tar.gz → 0.2.4__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.4}/PKG-INFO +2 -2
  2. eido-0.2.4/eido/_version.py +1 -0
  3. {eido-0.2.3 → eido-0.2.4}/eido/conversion_plugins.py +2 -3
  4. {eido-0.2.3 → eido-0.2.4}/eido/output_formatters.py +1 -1
  5. {eido-0.2.3 → eido-0.2.4}/eido/validation.py +4 -0
  6. {eido-0.2.3 → eido-0.2.4/eido.egg-info}/PKG-INFO +2 -2
  7. {eido-0.2.3 → eido-0.2.4}/eido.egg-info/requires.txt +1 -1
  8. {eido-0.2.3 → eido-0.2.4}/requirements/requirements-all.txt +1 -1
  9. {eido-0.2.3 → eido-0.2.4}/tests/test_conversions.py +31 -1
  10. {eido-0.2.3 → eido-0.2.4}/tests/test_validations.py +9 -4
  11. eido-0.2.3/eido/_version.py +0 -1
  12. {eido-0.2.3 → eido-0.2.4}/LICENSE.txt +0 -0
  13. {eido-0.2.3 → eido-0.2.4}/MANIFEST.in +0 -0
  14. {eido-0.2.3 → eido-0.2.4}/README.md +0 -0
  15. {eido-0.2.3 → eido-0.2.4}/eido/__init__.py +0 -0
  16. {eido-0.2.3 → eido-0.2.4}/eido/__main__.py +0 -0
  17. {eido-0.2.3 → eido-0.2.4}/eido/argparser.py +0 -0
  18. {eido-0.2.3 → eido-0.2.4}/eido/cli.py +0 -0
  19. {eido-0.2.3 → eido-0.2.4}/eido/const.py +0 -0
  20. {eido-0.2.3 → eido-0.2.4}/eido/conversion.py +0 -0
  21. {eido-0.2.3 → eido-0.2.4}/eido/exceptions.py +0 -0
  22. {eido-0.2.3 → eido-0.2.4}/eido/inspection.py +0 -0
  23. {eido-0.2.3 → eido-0.2.4}/eido/schema.py +0 -0
  24. {eido-0.2.3 → eido-0.2.4}/eido.egg-info/SOURCES.txt +0 -0
  25. {eido-0.2.3 → eido-0.2.4}/eido.egg-info/dependency_links.txt +0 -0
  26. {eido-0.2.3 → eido-0.2.4}/eido.egg-info/entry_points.txt +0 -0
  27. {eido-0.2.3 → eido-0.2.4}/eido.egg-info/top_level.txt +0 -0
  28. {eido-0.2.3 → eido-0.2.4}/requirements/requirements-doc.txt +0 -0
  29. {eido-0.2.3 → eido-0.2.4}/requirements/requirements-test.txt +0 -0
  30. {eido-0.2.3 → eido-0.2.4}/setup.cfg +0 -0
  31. {eido-0.2.3 → eido-0.2.4}/setup.py +0 -0
  32. {eido-0.2.3 → eido-0.2.4}/tests/test_schema_operations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eido
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A project metadata validator
5
5
  Home-page: https://github.com/pepkit/eido/
6
6
  Author: Michal Stolarczyk, Nathan Sheffield
@@ -19,7 +19,7 @@ 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
21
  Requires-Dist: pandas
22
- Requires-Dist: peppy>=0.40.6
22
+ Requires-Dist: peppy>=0.40.7
23
23
  Requires-Dist: ubiquerg>=0.5.2
24
24
 
25
25
  # <img src="docs/img/eido.svg" alt="eido logo" height="70">
@@ -0,0 +1 @@
1
+ __version__ = "0.2.4"
@@ -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),
@@ -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
 
@@ -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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eido
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A project metadata validator
5
5
  Home-page: https://github.com/pepkit/eido/
6
6
  Author: Michal Stolarczyk, Nathan Sheffield
@@ -19,7 +19,7 @@ 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
21
  Requires-Dist: pandas
22
- Requires-Dist: peppy>=0.40.6
22
+ Requires-Dist: peppy>=0.40.7
23
23
  Requires-Dist: ubiquerg>=0.5.2
24
24
 
25
25
  # <img src="docs/img/eido.svg" alt="eido logo" height="70">
@@ -1,7 +1,7 @@
1
1
  jsonschema>=3.0.1
2
2
  logmuse>=0.2.5
3
3
  pandas
4
- peppy>=0.40.6
4
+ peppy>=0.40.7
5
5
  ubiquerg>=0.5.2
6
6
 
7
7
  [:python_version < "3.10"]
@@ -2,5 +2,5 @@ importlib-metadata; python_version < '3.10'
2
2
  jsonschema>=3.0.1
3
3
  logmuse>=0.2.5
4
4
  pandas
5
- peppy>=0.40.6
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
File without changes
File without changes