datalad / datalad-catalog

Create a user-friendly data catalog from structured metadata
https://datalad-catalog.netlify.app
MIT License
14 stars 12 forks source link

RF: move from single entrypoint API to entrypoint per command #309

Closed jsheunis closed 1 year ago

jsheunis commented 1 year ago

The main goal of this PR is to close https://github.com/datalad/datalad-catalog/issues/245. IN the process, the PR evolved a lot and now includes these main changes:

Some specific outcomes to take note of:

Issues that are addressed by this PR:

jsheunis commented 1 year ago

@mslw I think this comment from above is particularly relevant to you, since you also maintain a couple of translators:

Translation functionality is refactored, and requires updated to existing translators:

  • With the new catalog argument, translation occurs to the specific schema version of the catalog (if supported by an available translator); if the catalog argument is not supplied, the expected schema version is the latest supported by the package installation.
  • The translator matching process is streamlined by keeping track of previously matched and instantiated translators
  • Functionality to get the supported schema version, source name, and source version have been moved to the translator base class in order to support the abovementioned changes. This means existing and new translators will have to override these functions.
codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 91.45% and project coverage change: +3.81 :tada:

Comparison is base (f612cb1) 82.32% compared to head (57bf6b4) 86.14%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #309 +/- ## ========================================== + Coverage 82.32% 86.14% +3.81% ========================================== Files 32 43 +11 Lines 2173 2700 +527 ========================================== + Hits 1789 2326 +537 + Misses 384 374 -10 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `79.00% <88.17%> (+7.24%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad) | Coverage Δ | | |---|---|---| | [datalad\_catalog/\_\_init\_\_.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL19faW5pdF9fLnB5) | `100.00% <ø> (ø)` | | | [...lad\_catalog/translators/bids\_dataset\_translator.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL3RyYW5zbGF0b3JzL2JpZHNfZGF0YXNldF90cmFuc2xhdG9yLnB5) | `48.05% <ø> (ø)` | | | [...lad\_catalog/translators/datacite\_gin\_translator.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL3RyYW5zbGF0b3JzL2RhdGFjaXRlX2dpbl90cmFuc2xhdG9yLnB5) | `100.00% <ø> (ø)` | | | [...lad\_catalog/translators/metalad\_core\_translator.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL3RyYW5zbGF0b3JzL21ldGFsYWRfY29yZV90cmFuc2xhdG9yLnB5) | `91.66% <ø> (ø)` | | | [...og/translators/metalad\_studyminimeta\_translator.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL3RyYW5zbGF0b3JzL21ldGFsYWRfc3R1ZHltaW5pbWV0YV90cmFuc2xhdG9yLnB5) | `94.44% <ø> (ø)` | | | [datalad\_catalog/workflow.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL3dvcmtmbG93LnB5) | `67.70% <67.70%> (ø)` | | | [datalad\_catalog/catalog.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL2NhdGFsb2cucHk=) | `90.00% <75.00%> (+9.88%)` | :arrow_up: | | [datalad\_catalog/serve.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL3NlcnZlLnB5) | `77.77% <77.77%> (ø)` | | | [datalad\_catalog/add.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL2FkZC5weQ==) | `80.95% <80.95%> (ø)` | | | [datalad\_catalog/webcatalog.py](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jYXRhbG9nL3dlYmNhdGFsb2cucHk=) | `81.81% <81.31%> (-8.06%)` | :arrow_down: | | ... and [26 more](https://app.codecov.io/gh/datalad/datalad-catalog/pull/309?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.