-
Notifications
You must be signed in to change notification settings - Fork 11
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
enh: implement metadata aggregator for asset summary #34
Conversation
Codecov Report
@@ Coverage Diff @@
## master #34 +/- ##
==========================================
+ Coverage 94.65% 95.75% +1.09%
==========================================
Files 11 11
Lines 879 965 +86
==========================================
+ Hits 832 924 +92
+ Misses 47 41 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
IMHO aggregate is not sufficiently descriptive of it purpose and behavior (mutates, instead of return aggregated value). AFAIK this function is not (yet at least) to be used by external tools, so I made it protected. Also added some type hints while at it
It is used only once, not generic (spreads logic about variableMeasured). Placing that logic directly where used IMHO makes it easier to follow the code
That is AFAIK where all models are defined and IMHO they should not be in metadata, which is supporting functionality for dealing with all those models/metadata
so we somehow do not match a directory or some funkily named non-nii file
I do not quite like aggregate_assets_summary and would prefer to start producing constructors such as AssetsSummary.from_metadata and alike. But I disliked toSummary more: name camel cased, mutating provided stats. Notable other difference - decided to return AssetsSummary itself, and let outside code to do .json_dict() or any other desired serializer
Made them all private since we do not / want to expose them AFAIK since otherwise would become a part of the interface etc
Detected by mypy and I think it would be a legit thing to do
to keep metadata module interface free of manipulating models. Later we might RF to get AssetsSummary.from_assets and alike
Explicit better than implicit and IMHO semantically (since we are not saying that it is ALLOWED_OLDER_INPUT_SCHEMAS) I think it would be more correct. Did it in the code to avoid hardcoding duplicates
* upstream/master: Update dandischema/datacite.py Only attempt to remove contributorType if present
Let's proceed! |
This PR implements the computation of asset summary for a dandiset to this library.
addresses part 1 of dandi/dandi-archive#337
will file a PR on API to use this.