Open erikhuck opened 6 months ago
@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 https://github.com/MoseleyBioinformaticsLab/gpu_tracker/issues/25#issuecomment-2038100490, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEP7B2L3OI4GMQLB4IP7V3Y3WWE5AVCNFSM6AAAAABFT7Y4P6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZYGEYDANBZGA . You are receiving this because you were mentioned.Message ID: @.***>
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.
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
.