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

fix a typo in metadata field #749

Merged
merged 11 commits into from
Aug 20, 2024
Merged

fix a typo in metadata field #749

merged 11 commits into from
Aug 20, 2024

Conversation

Tianhao-Gu
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 10.52632% with 17 lines in your changes missing coverage. Please review.

Project coverage is 46.08%. Comparing base (0b9bf50) to head (8def914).
Report is 12 commits behind head on develop.

Files Patch % Lines
src/loaders/compute_tools/tool_common.py 10.52% 17 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #749      +/-   ##
===========================================
- Coverage    46.16%   46.08%   -0.08%     
===========================================
  Files           78       78              
  Lines         7047     7059      +12     
===========================================
  Hits          3253     3253              
- Misses        3794     3806      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

Choose a reason for hiding this comment

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

Release notes for the metadata change

While you're doing that, could you update release notes for all the changes since the last release?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the main release note? Yea. I am planning to do it with the BBMap PR.

Copy link
Member

Choose a reason for hiding this comment

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

ok, as long as the changes from this pr are included

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

Comment on lines 75 to 85
metadata = {'tool_name': 'checkm2',
'version': '1.0.1',
'command': command,
"reference_db": {
"version": None,
"comment": "diamond_db, ver unknown",
},
'ids_to_files': ids_to_files}
'ids_to_files': make_json_serializable(ids_to_files),
'run_time': round(run_time, 2),
'batch_size': size,
}
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make more sense, now I think about it, to handle this outside the container? Then the code would live in one place rather than having to duplicate it for every container

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmmm which block of code are you referring to? Generate the metadata outside of container? something like making create_tool_metadata takes command, run_time, size, etc.?

Copy link
Member

Choose a reason for hiding this comment

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

Generate the metadata outside of container?

right. The running code should know all this stuff, so you could abstract it all out of the containers

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

Copy link
Member

@MrCreosote MrCreosote Aug 19, 2024

Choose a reason for hiding this comment

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

This is something that could probably be done later though, as I assume it'd be a big lift

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 I moved everything to create_tool_metadata.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, missed this.

I mean the metadata code doesn't run in the container at all, and is written by code after the container exits. Then you don't need to add it to every tool, it Just Works

Copy link
Collaborator Author

@Tianhao-Gu Tianhao-Gu Aug 20, 2024

Choose a reason for hiding this comment

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

That probably won’t be a good idea. If we move this logic completely outside of container, we will need if statement for each tool for tool specific metadata. And For ‘command’ metadata, we also need to return the command.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so, most of the additional metadata is either source file, data id, ref db version, or ids_to_files, which is either known or can be looked up by looking in the tool directory. The only anomaly is mash, and for that there could be an method in each tool dir, that if it exists, takes the input args and returns the extra metadata.

For the command, the command = fn(input_args) so there could also be a method that does that translation that is used both in the container to start the executable and outside the container to generate the metadata.

Anyway, that's a different PR if it gets done at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

@Tianhao-Gu Tianhao-Gu merged commit 4c4a7f9 into develop Aug 20, 2024
14 of 16 checks passed
@Tianhao-Gu Tianhao-Gu deleted the dev_fix_metadata_field branch August 20, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants