-
Notifications
You must be signed in to change notification settings - Fork 20
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
Remove dead modules #212
Remove dead modules #212
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #212 +/- ##
===========================================
+ Coverage 80.99% 95.60% +14.61%
===========================================
Files 19 17 -2
Lines 2252 1913 -339
===========================================
+ Hits 1824 1829 +5
+ Misses 428 84 -344
☔ View full report in Codecov by Sentry. |
134c605
to
5fb5b2a
Compare
@classmethod | ||
def is_association(cls, asn_data): | ||
""" | ||
Test if an object is an association by checking for required fields | ||
""" | ||
if isinstance(asn_data, dict): | ||
if "asn_id" in asn_data and "asn_pool" in asn_data: | ||
return True | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mairanteodoro requested that we keep this method in roman_datamodels
but we directly associate it with the AssociationsModel
as that is what it is needed for.
This change simply binds the is_association
method with the AssociationsModel
to make the relationship clear. romancal
will simply call AssociationsModel.is_association
in a utility is_association
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WilliamJamieson I'm OK with moving it out of roman_datamodels
.
@pytest.mark.parametrize( | ||
"expected, asn_data", | ||
[ | ||
(True, {"asn_id": "foo", "asn_pool": "bar"}), | ||
(False, {"asn_id": "foo"}), | ||
(False, {"asn_pool": "bar"}), | ||
(False, {"foo": "bar"}), | ||
(False, "foo"), | ||
], | ||
) | ||
def test_is_association(expected, asn_data): | ||
""" | ||
Test the is_association function. | ||
""" | ||
|
||
assert datamodels.AssociationsModel.is_association(asn_data) is expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, test the is_association
(it was never tested before).
3406094
to
10e8106
Compare
10e8106
to
f154171
Compare
Close/reopen due to messing up branch pushes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we adding mktest
and utils
to the romancal
docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they were linked to in the roman_datamodels
docs accidentally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo @mairanteodoro's approval.
This PR removes some dead modules:
roman_datamodels.utils
roman_datamodels.mktest
These modules appear to be untested, unused, duplicate other functionality, and essentially abandoned.
Checklist
CHANGES.rst
under the corresponding subsectionis_assocation
toromancal
romancal#719 changes)