-
Notifications
You must be signed in to change notification settings - Fork 1
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
API feedback #25
Comments
@hunter-moseley Question about the first bullet point. Basing the text output on the JSON enforces consistency. I understand the implementation is a bit messy, but wouldn't manually constructing the string possibly be more error-prone? |
Do something like the following:
template = """
Max RAM:
Unit: gigabytes
System capacity: {max_ram["system_capacity"]}
System: {max_ram["system"]}
Main:
Total RSS: main["total_rss"]}
Private RSS: main["private_rss"]}
Shared RSS: main["shared_rss"]}
Descendents:
...
"""
return template.format(**json_dict)
…On Thu, Apr 4, 2024 at 3:58 PM Erik Huckvale ***@***.***> wrote:
@hunter-moseley <https://github.com/hunter-moseley> Question about the
first bullet point. Basing the text output on the JSON enforces
consistency. I understand the implementation is a bit messy, but wouldn't
manually constructing the string possibly be more error-prone?
—
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADEP7B2L3OI4GMQLB4IP7V3Y3WWE5AVCNFSM6AAAAABFT7Y4P6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZYGEYDANBZGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Hunter Moseley, Ph.D. -- Univ. of Kentucky
Professor, Dept. of Molec. & Cell. Biochemistry / Markey Cancer Center
/ Institute for Biomedical Informatics / UK Superfund Research Center
Not just a scientist, but a fencer as well.
My foil is sharp, but my mind sharper still.
---------------------------------------------------------------
Email: ***@***.*** (work) ***@***.***
(personal)
Phone: 859-218-2964 (office) 859-218-2965 (lab) 859-257-7715 (fax)
Web: http://bioinformatics.cesb.uky.edu/
Address: CC434 Roach Building, 800 Rose Street, Lexington, KY 40536-0093
|
@hunter-moseley great idea! Then we get the best of both. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suggested changes from Dr. Moseley:
__str__
output is a bit inelegant. Should be able to replace this with some sort of template that utilizes the values in the JSON nested dictionary. But this would be an improvement for later. A simple multiline formatted string may work as the template._gpu_ram_unit2coefficient
and_ram_unit2coefficient
and_time_unit2coefficient
._validate_mem_unit
and use_gpu_ram_unit2coefficient.keys()
passed to_validate_unit
.The text was updated successfully, but these errors were encountered: