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

Subclass sync: Comments & minor refactor #736

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

joeflack4
Copy link
Contributor

@joeflack4 joeflack4 commented Dec 20, 2024

Overview

At first I was going to add some helpful comments, but I realized some refactoring could be done.

Pre-merge checklist

Documentation

Was the documentation added/updated under docs/?

  • Yes
  • No, updates to the docs were not necessary after careful consideration

QC

Was the full pipeline run before submitting this PR using sh run.sh make build-mondo-ingest on this branch (after
docker pull obolibrary/odkfull:dev), and no errors occurred?

  • Yes
  • No, there are no functional (code-related) changes to the pipeline in the PR, so no re-run is necessary

Build:

New Packages

Were any new Python packages added?

Were any other non-Python packages added?

PR Review and Conversations Resolved

Has the PR been sufficiently reviewed by at least 1 team member of the Mondo Technical team and all threads resolved?

  • Yes

Additional info

One refactor here removes a redundant variable rels_mondo_mondo_all and replaces it with rels_direct_mondo_mondo. I tested and confirmed these variables were equivalent.

- Update: _convert_edge_namespace(): (i) removed unused optional param, (ii) improved documentation.
- Update: Improved some comments explaining some confusingly named variables.
- Update: Removed 'verbose' param from _get_direct_scr_rels(). This function ran fast, and there was no need to print out the time taken.
- Update: Misc codestyle refactors
- Update: Case 5 code: Was redundant with some other code. Made DRY.
@joeflack4 joeflack4 changed the base branch from main to develop December 20, 2024 21:57
@joeflack4 joeflack4 self-assigned this Dec 20, 2024
@joeflack4 joeflack4 requested a review from twhetzel December 20, 2024 21:57
@joeflack4 joeflack4 added enhancement New feature or request code quality House keeping and removed enhancement New feature or request labels Dec 20, 2024
@joeflack4 joeflack4 requested a review from matentzn December 20, 2024 21:59
@joeflack4
Copy link
Contributor Author

@twhetzel @matentzn Low priorities. Maybe look at next month? Happy holidays!

rels_mondo_mondo_all = set( # filter non-source parents
[x for x in rels_mondo_raw_all if any([x[2].startswith(y) for y in MONDO_PREFIX_MAP.keys()])])
df5 = pd.DataFrame([{'subject_id': x[0], 'object_id': x[2]} for x in rels_mondo_mondo_all])
df5 = pd.DataFrame([{'subject_id': x[0], 'object_id': x[2]} for x in rels_direct_mondo_mondo])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeflack4 what change in the subclass data files does this make?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that is what is mentioned in the OP, and I mentioned in passing at meeting possibly before the holidays:

One refactor here removes a redundant variable rels_mondo_mondo_all and replaces it with rels_direct_mondo_mondo. I tested and confirmed these variables were equivalent.

So there are no changes in outputs.

Copy link
Contributor

@twhetzel twhetzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment inline

@joeflack4
Copy link
Contributor Author

@matentzn Your review on this as well whenever. Not time sensitive. Removes a duplicate variable. Outputs did not change at all, which can be seen in the mini build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality House keeping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants