@@ -73,6 +73,9 @@ cdef class JobSubmitDescription:
73
73
74
74
slurm_init_job_desc_msg(self .ptr)
75
75
76
+ def __repr__ (self ):
77
+ return f' pyslurm.{self.__class__.__name__}'
78
+
76
79
def submit (self ):
77
80
""" Submit a batch job description.
78
81
@@ -87,9 +90,12 @@ cdef class JobSubmitDescription:
87
90
>>> desc = pyslurm.JobSubmitDescription(
88
91
... name="test-job",
89
92
... cpus_per_task=1,
90
- ... time_limit="10-00:00:00")
93
+ ... time_limit="10-00:00:00",
94
+ ... script="/path/to/your/submit_script.sh")
91
95
>>>
92
96
>>> job_id = desc.submit()
97
+ >>> print(job_id)
98
+ 99
93
99
"""
94
100
cdef submit_response_msg_t * resp = NULL
95
101
@@ -112,9 +118,9 @@ cdef class JobSubmitDescription:
112
118
113
119
Args:
114
120
overwrite (bool):
115
- If set to True, the value from an option found in the
121
+ If set to ` True` , the value from an option found in the
116
122
environment will override the current value of the attribute
117
- in this instance. Default is False
123
+ in this instance. Default is ` False`
118
124
119
125
Examples:
120
126
Lets consider you want to set the name of the Job, its Account
@@ -141,13 +147,13 @@ cdef class JobSubmitDescription:
141
147
self ._parse_env(overwrite)
142
148
143
149
def load_sbatch_options (self , overwrite = False ):
144
- """ Load values from #SBATCH options in the batch script.
150
+ """ Load values from ` #SBATCH` options in the batch script.
145
151
146
152
Args:
147
153
overwrite (bool):
148
- If set to True, the value from an option found in the in the
154
+ If set to ` True` , the value from an option found in the in the
149
155
batch script will override the current value of the attribute
150
- in this instance. Default is False
156
+ in this instance. Default is ` False`
151
157
"""
152
158
if not self .script:
153
159
raise ValueError (" You need to set the 'script' attribute first." )
0 commit comments