sdss / sdss/datamodel

YAML won't validate?

Open
#151 4 comments 0 reactions 2 assignees View on GitHub

@joelbrownstein is already working on this.

Since Mar 11, 2025.

Dominant language
Python
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Hi Brian,

I have a fits file on the SAS in the dr19 tree at MWM_MDWARF/elemental_abundances/mdwarf_abundances-1.0.1.fits

I can generate a YAML file and fix the replace me's:
https://github.com/sdss/datamodel/blob/vac11/datamodel/products/yaml/mdwarf_abundances.yaml

But I cannot get a JSON either from datamodel_update or datamodel_generate with the following errors that I can't use to make a fix. Can you tell me what I'm doing wrong? Or perhaps a bug creeped in after the latest PR since this vac11 branch was created from main.

[u0707758@archive:products]$ datamodel_update -f mdwarf_abundances -r DR19
[INFO]: Updating datamodel mdwarf_abundances.
[ERROR]: DM update failed. Could not write stubs for mdwarf_abundances. Error: Cannot create a new cache.  The md stub is not cacheable or does not have a valid template to create a cache. Please create a cacheable yaml file first.

or

[u0707758@archive:products]$ datamodel_generate -f mdwarf_abundances -p MWM_MDWARF/elemental_abundances/mdwarf_abundances-{vers}.fits -k vers=1.0.1 --use-cache DR19 --hdus-only
False None
[ERROR]: Traceback (most recent call last):
  File "/uufs/astro.utah.edu/common/home/u0707758/software/datamodel/vac11/python/datamodel/cli.py", line 333, in <module>
    cli()
  File "/uufs/chpc.utah.edu/common/home/sdss50/software/pkg/miniconda/3.11.8/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/uufs/chpc.utah.edu/common/home/sdss50/software/pkg/miniconda/3.11.8/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/uufs/chpc.utah.edu/common/home/sdss50/software/pkg/miniconda/3.11.8/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/uufs/chpc.utah.edu/common/home/sdss50/software/pkg/miniconda/3.11.8/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/uufs/chpc.utah.edu/common/home/sdss50/software/pkg/miniconda/3.11.8/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/uufs/astro.utah.edu/common/home/u0707758/software/datamodel/vac11/python/datamodel/cli.py", line 85, in generate
    dm.write_stubs(force=force, use_cache_release=use_cache,
  File "/uufs/astro.utah.edu/common/home/u0707758/software/datamodel/vac11/python/datamodel/generate/datamodel.py", line 625, in write_stubs
    ss.write(force=force, use_cache_release=use_cache_release, full_cache=full_cache,
  File "/uufs/astro.utah.edu/common/home/u0707758/software/datamodel/vac11/python/datamodel/generate/stub.py", line 527, in write
    self.render_content(force=force, release=release, group=group)
  File "/uufs/astro.utah.edu/common/home/u0707758/software/datamodel/vac11/python/datamodel/generate/stub.py", line 511, in render_content
    self._get_cache(force=force)
  File "/uufs/astro.utah.edu/common/home/u0707758/software/datamodel/vac11/python/datamodel/generate/stub.py", line 232, in _get_cache
    content = self._create_cache()
              ^^^^^^^^^^^^^^^^^^^^
  File "/uufs/astro.utah.edu/common/home/u0707758/software/datamodel/vac11/python/datamodel/generate/stub.py", line 204, in _create_cache
    raise ValueError(f'Cannot create a new cache.  The {self.format} stub is not '
ValueError: Cannot create a new cache.  The md stub is not cacheable or does not have a valid template to create a cache. Please create a cacheable yaml file first.

Error finding cli file.  If the datamodel product was pip installed, try running "datamodel generate" instead.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.