Replies: 1 comment 3 replies
-
|
Hi, For your first concern, just a little reasoning why it is like this: every slurm API call requires that first the However, in your case, if you just want to inspect the classes without having slurm configured as a whole, it makes sense to actually not run this automatically, as it will fail if there is no I could make this For your second problem: You could potentially rely on the Docstrings of each class. Here is an example: import pyslurm
import griffe
docstring = griffe.Docstring(pyslurm.Job.__doc__)
text, params, attrs = griffe.parse_google(docstring)
for attr in attrs.value:
print(attr.name, attr.description, attr.annotation)This way you would get every attribute available on a specific Class, alongside its type and the description of it. Would that work? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a GUI that interfaces with pyslurm.
Firstly the GUI can display Jobs from a cluster and allows sorting, filtering and manipulating them in a few ways. I'm getting the jobs from pyslurm and can display all the data raw in a table. But then I have columns like derived_exit_code_signal or federation_siblings_viable. To make things nicer I have a list of the possible fields with a nicer looking name for the column and a tooltip text and also hints how to make the data more human readable (e.g. time durations are turned into days/hours/minutes).
The problem I face is that with each new slurm / pyslurm version the jobs fields can change. So I want to get a list of fields a Job can have at build time and check if that differs from what the GUI has listed. One Idea I have is to use
Secondly the GUI also manages Reservations. So it needs to know about pyslurm.ReservationFlags and pyslurm.ReservationReoccurrence. There I can use:
But I'm left with one BIG and one small problem:
There is no slurm configured on the build system:
Pyslurm can't be imported when slurm is not configured. I really don't want to have to setup slurm on the build system and automated CI checks. Can this be fixed?
Any tips how to best find that info from either pyslurm source or slurm source?
Currently I'm manually checking slurm/slurm.h and use the comment behind each struct job_info member or #define for reservation flags as tooltip.
Beta Was this translation helpful? Give feedback.
All reactions