Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract datamodel to json and excel #18

Merged
merged 20 commits into from
Jan 10, 2025
Merged

Conversation

JosePizarro3
Copy link
Contributor

Added CLI features to extract the datamodel objects and print them to json in a subfolder bam_data_store/datamodel/artifacts/.

@JosePizarro3
Copy link
Contributor Author

I've merged the export-to-excel implementation as well

@JosePizarro3 JosePizarro3 force-pushed the 11-extract-datamodel-json branch from d1c65b4 to 415074d Compare December 18, 2024 10:16
@coveralls
Copy link

coveralls commented Dec 18, 2024

Pull Request Test Coverage Report for Build 12391007429

Details

  • 34 of 171 (19.88%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-34.3%) to 47.419%

Changes Missing Coverage Covered Lines Changed/Added Lines %
bam_data_store/datamodel/property_types.py 0 2 0.0%
bam_data_store/metadata/entities.py 5 7 71.43%
bam_data_store/metadata/definitions.py 6 10 60.0%
bam_data_store/datamodel/collection_types.py 0 7 0.0%
bam_data_store/utils/utils.py 23 34 67.65%
bam_data_store/cli/entities_to_json.py 0 35 0.0%
bam_data_store/cli/cli.py 0 36 0.0%
bam_data_store/cli/entities_to_excel.py 0 40 0.0%
Totals Coverage Status
Change from base Build 12390657740: -34.3%
Covered Lines: 147
Relevant Lines: 310

💛 - Coveralls

@JosePizarro3 JosePizarro3 force-pushed the 11-extract-datamodel-json branch from d16b209 to aefe66e Compare December 18, 2024 13:17
@coveralls
Copy link

coveralls commented Dec 18, 2024

Pull Request Test Coverage Report for Build 12709560814

Details

  • 152 of 207 (73.43%) changed or added relevant lines in 9 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+96.6%) to 97.29%

Changes Missing Coverage Covered Lines Changed/Added Lines %
bam_masterdata/openbis/get_entities.py 2 3 66.67%
bam_masterdata/metadata/entities.py 13 15 86.67%
bam_masterdata/cli/entities_to_excel.py 51 54 94.44%
bam_masterdata/cli/entities_to_json.py 31 36 86.11%
bam_masterdata/utils/utils.py 27 33 81.82%
bam_masterdata/cli/fill_masterdata.py 2 9 22.22%
bam_masterdata/cli/cli.py 14 45 31.11%
Files with Coverage Reduction New Missed Lines %
bam_masterdata/openbis/get_entities.py 1 19.23%
Totals Coverage Status
Change from base Build 12691091810: 96.6%
Covered Lines: 16368
Relevant Lines: 16824

💛 - Coveralls

@JosePizarro3 JosePizarro3 changed the title Extract datamodel to json Extract datamodel to json and excel Dec 18, 2024
@JosePizarro3 JosePizarro3 force-pushed the 11-extract-datamodel-json branch 4 times, most recently from af2dd3c to 0cb5a34 Compare January 9, 2025 13:03
@JosePizarro3
Copy link
Contributor Author

JosePizarro3 commented Jan 9, 2025

@carlosmada22 these are my changes to generate JSONs and the excel in the typical format of openBIS from our classes in the datamodel/. This is a good opportunity for you to see a better CLI than argparse (using click); check the cli/ folder please.

Could you try checking out in this branch and doing:

bam_masterdata export_to_json

or:

bam_masterdata export_to_excel

And see whether it makes sense what is being printed out.

With this changes, we can start thinking about connecting excel with Python/JSON, and allow people to have a full environment for developing data models. There is left a TODO, which is in #35 (i.e., exporting/importing from WebProtege), but this we can do later.


And btw, I had to fix a minor thing from the fill_masterdata.py: apparently, the data type has changed from SAMPLE to OBJECT at some point. See #42, I decided to separate those changes from this branch.

@JosePizarro3 JosePizarro3 force-pushed the 11-extract-datamodel-json branch from 0cb5a34 to 48cc135 Compare January 9, 2025 13:45
@JosePizarro3 JosePizarro3 merged commit e348c82 into main Jan 10, 2025
8 checks passed
@JosePizarro3 JosePizarro3 deleted the 11-extract-datamodel-json branch January 10, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants