[ENG-7445] Added IndexcardJsonDeriver#868
Conversation
trove/derive/osfmap_json_mini.py
Outdated
|
|
||
| @staticmethod | ||
| def _should_keep_predicate(predicate: str) -> bool: | ||
| return True if predicate in PREDICATE_LIST else True |
aaxelb
left a comment
There was a problem hiding this comment.
small requests and a rename; seems near ready
trove/derive/osfmap_json_mini.py
Outdated
| ns.DCTERMS.dateModified, | ||
| ns.OSFMAP.hostingInstitution, | ||
| ns.OSFMAP.keyword, | ||
| ns.OSFMAP.contains, |
There was a problem hiding this comment.
osf:contains is probably the property most worth excluding -- lists every osfguid-identified file in an osf proj/reg, which could be many (and could be helpful sometimes but we do not need that in search results)
trove/derive/osfmap_json_mini.py
Outdated
|
|
||
| @staticmethod | ||
| def _should_keep_predicate(predicate: str) -> bool: | ||
| return True if predicate in INCLUDED_PREDICATE_SET else False |
There was a problem hiding this comment.
| return True if predicate in INCLUDED_PREDICATE_SET else False | |
| return (predicate in INCLUDED_PREDICATE_SET) |
nit: the ternary here overcomplicates (the parentheses aren't necessary but i think they help clarify intent for the hasty reader)
trove/derive/osfmap_json_mini.py
Outdated
| }) | ||
|
|
||
|
|
||
| class IndexcardJsonDeriver(OsfmapJsonFullDeriver): |
There was a problem hiding this comment.
(was going to ignore this but then i got confused often enough while reading it seems worthwhile to) rename IndexcardJsonDeriver to OsfmapJsonMiniDeriver, to be consistent with the module and parent class naming
| self.assertEqual(expected, json.loads(actual)) | ||
|
|
||
|
|
||
| class TestIndexcardJsonDeriver(BaseIndexcardDeriverTest): |
There was a problem hiding this comment.
belongs in its own file test_osfmap_json_mini.py (aligning with the other test files in this dir and mirroring code file layout)
eb3a993
into
CenterForOpenScience:feature/shtrove-enhance-2025-05
|
(oops meant to merge to develop -- have now done by hand) |
Added IndexcardJsonDeriver
https://openscience.atlassian.net/browse/ENG-7445