Skip to content

Commit

Permalink
Use PyBIS patch (#57)
Browse files Browse the repository at this point in the history
Add fix from pybis dev in new patched version
  • Loading branch information
JosePizarro3 authored Jan 23, 2025
1 parent 94c6fd5 commit 6d634f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions bam_masterdata/cli/fill_masterdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,18 @@ def generate_property_types(self) -> str:
lines.append(f' description="""{description}""",')
# ! patching dataType=SAMPLE instead of OBJECT
data_type = data.get("dataType", "")
object_type = data.get("sampleType", {})
if data_type == "SAMPLE":
data_type = "OBJECT"
lines.append(f' data_type="{data_type}",')
if object_type and isinstance(object_type, dict):
lines.append(f' object_code="{object_type.get("code", "")}",')
object_code = data.get("sampleType", "")
if object_code:
lines.append(f' object_code="{object_code}",')
property_label = (
(data.get("label") or "").replace('"', '\\"').replace("\n", "\\n")
)
if data.get("dataType", "") == "CONTROLLEDVOCABULARY":
lines.append(f' vocabulary_code="{data.get("vocabulary", "")}",')
vocabulary_code = data.get("vocabulary", "")
if vocabulary_code:
lines.append(f' vocabulary_code="{vocabulary_code}",')
lines.append(f' property_label="{property_label}",')
lines.append(")")
lines.append("")
Expand Down
1 change: 1 addition & 0 deletions bam_masterdata/datamodel/property_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,7 @@
code="INSTRUMENT",
description="""Testing machine or measurement device//Prüfmaschine oder Messgerät""",
data_type="OBJECT",
# object_code="(ALL)",
property_label="Testing Machine or Measurement Device",
)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ maintainers = [
]
license = { file = "LICENSE" }
dependencies = [
"pybis~=1.37",
"pybis~=1.37.1rc4",
"openpyxl",
"click",
"pydantic",
Expand Down

2 comments on commit 6d634f7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
bam_masterdata
   logger.py80100% 
bam_masterdata/cli
   cli.py643737 42%
   entities_to_excel.py5433 94%
   entities_to_json.py3655 86%
   fill_masterdata.py188175175 7%
bam_masterdata/datamodel
   collection_types.py370100% 
   dataset_types.py184184184 0%
   object_types.py15150100% 
   property_types.py8000100% 
   vocabulary_types.py137210100% 
bam_masterdata/metadata
   definitions.py780100% 
   entities.py5433 94%
bam_masterdata/openbis
   get_entities.py534343 19%
   login.py633 50%
bam_masterdata/utils
   utils.py4077 82%
TOTAL1683846097% 

Tests Skipped Failures Errors Time
58 1 💤 0 ❌ 0 🔥 18.550s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
bam_masterdata
   logger.py80100% 
bam_masterdata/cli
   cli.py643737 42%
   entities_to_excel.py5433 94%
   entities_to_json.py3655 86%
   fill_masterdata.py188175175 7%
bam_masterdata/datamodel
   collection_types.py370100% 
   dataset_types.py184184184 0%
   object_types.py15150100% 
   property_types.py8000100% 
   vocabulary_types.py137210100% 
bam_masterdata/metadata
   definitions.py780100% 
   entities.py5433 94%
bam_masterdata/openbis
   get_entities.py534343 19%
   login.py633 50%
bam_masterdata/utils
   utils.py4077 82%
TOTAL1683846097% 

Tests Skipped Failures Errors Time
58 1 💤 0 ❌ 0 🔥 18.818s ⏱️

Please sign in to comment.