Skip to content

Commit

Permalink
Regenerate SLURM models.py
Browse files Browse the repository at this point in the history
It has proven hard to reproduce the exact contents of the (automatically
generated) models.py. There seems to be differences in flags between
what is the documented way it was run vs the contents, the SLURM version,
and the fact that datamodel-code-generator output order does not seem
to be stable.

Thus, this is now regenerated with:

    datamodel-code-generator 0.25.8
    ripgrep
    jq

And the command:

    curl    -H "X-SLURM-USER-NAME: gda2" \
            -H "X-SLURM-USER-TOKEN: $(cat /dls_sw/apps/zocalo/secrets/slurmrest-gda2.tkn)" \
            https://slurm-rest.diamond.ac.uk:8443/openapi/v3 \
                | jq --sort-keys \
        | rg --passthru -N '((?:db)?v)0.0.(\d+)_' -r '${1}00$2.' \
        | datamodel-codegen --target-python-version=3.8 \
            --use-schema-description \
            --use-field-description \
            --output-model-type=pydantic.BaseModel \
            --field-constraints \
            --use-double-quotes \
            --output models \
            --keep-model-order \
                && cp models/v0040.py src/zocalo/util/slurm/models.py

(then selecting models/v0040.py).
  • Loading branch information
ndevenish committed Jul 18, 2024
1 parent 1e4c9db commit 2d55c2d
Showing 1 changed file with 2,372 additions and 2,372 deletions.
Loading

0 comments on commit 2d55c2d

Please sign in to comment.