Skip to content

Commit 69d1d06

Browse files
Merge pull request #60 from AustralianBioCommons/fix-project-program-allowed-system-props
Fix project program allowed system props
2 parents 801c3c5 + 299d8dc commit 69d1d06

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "Gen3SchemaDev"
3-
version = "2.3.2"
3+
version = "2.3.3"
44
description = "Tool for data modelling in Gen3"
55
authors = [
66
{name = "JoshuaHarris391",email = "[email protected]"}

src/gen3schemadev/validators/rule_validator.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ def _system_props(self):
129129
return system_props
130130

131131
def props_cannot_be_system_props(self):
132+
133+
if self.schema.get('id', '') == 'project':
134+
logger.info("Skipping system property check for project schema.")
135+
return True
136+
137+
if self.schema.get('id', '') == 'program':
138+
logger.info("Skipping system property check for program schema.")
139+
return True
140+
132141
props = self._get_props()
133142
prop_keys = list(props.keys())
134143
schema_id = self.schema.get("id", "<unknown id>")

tests/test_converter.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def test_get_node_names(fixture_input_yaml_pass):
1919
node_names = get_node_names(fixture_input_yaml_pass)
2020
assert 'lipidomics_file' in node_names
2121
assert 'sample' in node_names
22-
assert 'project' in node_names
2322
assert 'assay' in node_names
2423

2524
def test_get_node_data(fixture_input_yaml_pass):
@@ -214,22 +213,22 @@ def test_create_link_prop():
214213

215214

216215
def test_get_properties(fixture_input_yaml_pass):
217-
result = get_properties("project", fixture_input_yaml_pass)
216+
result = get_properties("lipidomics_file", fixture_input_yaml_pass)
218217
expected = [
219218
{
220-
'project_id': {
221-
'type': 'string',
222-
'description': 'Synthetic_Dataset_1',
223-
'required': True,
224-
'enums': None
219+
"cv": {
220+
"type": "number",
221+
"description": "Coefficient of variation (%)",
222+
"enums": None,
223+
"required": True
225224
}
226225
},
227226
{
228-
'description': {
229-
'type': 'string',
230-
'description': 'Project containing synthetic data',
231-
'required': False,
232-
'enums': None
227+
"lipid_species": {
228+
"type": "array",
229+
"enums": None,
230+
"description": "List of lipid species",
231+
"required": False
233232
}
234233
}
235234
]

0 commit comments

Comments
 (0)