Slurmjobs

Latest version: v1.1.3

Safety actively analyzes 623657 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.1.2

-------------
- fix varargs not appearing in job ID

1.1.1

-------------
- add support for ``'*'`` and ``'**'`` which act as varargs to the script. Use ``'*'`` to pass positional arguments

1.1.0

-------------
- added singuconda binary to the scripts
- broke down `format_id_item` into `format_id_key` and `format_id_value` for easier overriding
- added better formattting for dicts, lists, and tuples
- job ID allowed character replacement applies to the whole job ID once it's formatted
- added `+=` as allowed job chars
- `Grid.as_grid(None)` returns a grid with a single empty entry
- overlay and sif are now enforced to have a value (not sure why this wasn't the default before)
- experimental ``GridFilter`` class added to allow filtering using functions (``e.g. grid | (lambda d: d if d['x'] != 5 else None)``)

Minor Changes
- Fixed Argument.get return type to avoid confusing type errors - no longer returns the class if key is empty
- Fixed receipt and Grid typing errors

1.0.0

-------------

- Rewrote like 70% of the code, including: jinja templates, jobs base class and subclasses
- added a :func:`slurmjobs.Singularity` class and template
- added parameter grid classes!! Lets you do grid arithmetic :)
- Renamed:

- ``slurmjobs.Batch`` => :func:`slurmjobs.Jobs`
- ``slurmjobs.SlurmBatch`` => :func:`slurmjobs.Slurm`
- ``slurmjobs.Jobs.default_options`` => ``slurmjobs.Jobs.options``
- ``slurmjobs.Jobs.JOB_ID_KEY`` => ``slurmjobs.Jobs.job_id_arg``

- Changed signatures:

- removed parameters from :func:`slurmjobs.Jobs.__init__`: ``multicmd, cmd_wrapper, init_script, run_init_script, post_script, paths``
- added ``Receipt(receipt_id='a-str-used-instead-of-hash_args()')``

- removed utilities:

- ``get_job_name``, ``make_job_name_tpl``, ``format_value_for_name``, ``_encode_special``, ``_decode_special``, ``_obliterate_special``:
replaced by :func:`slurmjobs.Jobs.format_id_item` and :func:`slurmjobs.Jobs.format_job_id`
- ``expand_grid``, ``expand_paired_params``, ``unpack``, ``split_cond`` replaced by :func:`slurmjobs.Grid`
- ``singularity_command`` replaced by :func:`slurmjobs.Singularity`
- ``Factory`` replaced by :func:`slurmjobs.util.subclass_lookup`

- :func:`slurmjobs.util.flatten` now returns a generator rather than a list.

- ``slurmjobs.Jobs.template`` and ``slurmjobs.Jobs.run_template`` both expect a template string (not a path).
to specify a path, either have a way to read it from file or just extend the template
- simplified argument formatting (removed special namedtuple classes)

- changed ``NoArgVal`` to just ``...``
- changed ``Argument.build`` to just ``Argument.__call__``
- improved how command, cli, and args are rendered (all done in jinja now)
- added overridable method ``Receipt.hash_args`` to allow for custom hashing
- added proper docs
- added tensorflow ``2.7`` to ``cuda_versions.csv``
- added ``scripts/singuconda`` and ``slurmjobs.singuconda`` as a WIP rewrite.

0.2.2

-------

- `cmd_wrapper` can also be a function
- added `util.find_tensorflow_cuda_version` to lookup cuda versions
- `util.singularity_command` returns a function that will now escape quotes in the passed command

0.2.1

-------

- Now you can pass in a list of dicts and it will use each dictionary as a job. This works along side the parameter grid expansion so you can do:
python
jobs.generate([{'param1': 5}, ('param1', [100, 150]), ('param2', [200, 250])])

- Added `cmd_wrapper` argument to `SlurmBatch('python myscript.py', cmd_wrapper=slurmjobs.util.singularity_command(overlay, sif))` for easier command formatting (no longer need to use `multicmd=True` and `{__all__}`). It expects a string with one positional format arg, e.g. ('sudo {}')

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.