LLNL / maestrowf

A tool to easily orchestrate general computational workflows both locally and on supercomputers
https://maestrowf.readthedocs.io
MIT License
133 stars 43 forks source link

validation of input and sheet_music testing #364

Open crkrenn opened 3 years ago

crkrenn commented 3 years ago

@FrankD412, (cc: @jsemler)

I have two coupled issues:

  1. maestro 1.1.8 won't work with long paths as global.parameters. (maestro 1.1.9dev1 fixes this problem.)
  2. maestro 1.1.9dev1 won't work with pgen_scisample.py, which is an approved example in maestro_sheetmusic. This is because of "improved" validation of the env block of the maestro input file. (pgen_scisample.py works with maestro 1.1.8.)

To solve issue 2, I need to relax the validation of the env block.

  1. Can you tell me how to do this? I will start my own investigation shortly.
  2. Can you tell me what kind of pull request you would accept to fix this in the develop branch?

To solve issue 2 more generally, I would suggest that you do some sort of automated testing of maestro_sheetmusic.

  1. Is this something you or Jessica know how to do?
  2. I'd be willing to add test_feature.py files to maestro_sheetmusic if you provide a framework for testing.

V/r,

-Chris

PS. Below is the stack trace when I try to run pgen_scisample.py with maestro 1.1.9dev1.

(venv_maestro) [reaction-rates]$ maestro run -y --pgen `which pgen_scisample.py` csv_sample.yaml  --hashws
[2021-06-11 15:30:35: INFO] INFO Logging Level -- Enabled
[2021-06-11 15:30:35: WARNING] WARNING Logging Level -- Enabled
[2021-06-11 15:30:35: CRITICAL] CRITICAL Logging Level -- Enabled
[2021-06-11 15:30:35: INFO] Loading specification -- path = csv_sample.yaml
[2021-06-11 15:30:35: ERROR] ("The value '{'type': 'csv', 'csv_file': 'out_reaction_only.csv', 'row_headers': False}' in field variables.SAMPLE_DICTIONARY of env is not of type 'string' or does not conform to the format '$(VARNAME)'.", <unset>, (), None, (), <unset>, <unset>, <unset>, (), None)
Traceback (most recent call last):
  File "/maestrowf/maestrowf/specification/yamlspecification.py", line 105, in load_specification
    specification = cls.load_specification_from_stream(data)
  File "/maestrowf/maestrowf/specification/yamlspecification.py", line 148, in load_specification_from_stream
    specification.verify()
  File "/maestrowf/maestrowf/specification/yamlspecification.py", line 163, in verify
    self.verify_environment(schemas["ENV"])
  File "/maestrowf/maestrowf/specification/yamlspecification.py", line 279, in verify_environment
    YAMLSpecification.validate_schema(
  File "maestrowf/maestrowf/specification/yamlspecification.py", line 460, in validate_schema
    raise jsonschema.ValidationError(
jsonschema.exceptions.ValidationError: The value '{'type': 'csv', 'csv_file': 'out_reaction_only.csv', 'row_headers': False}' in field variables.SAMPLE_DICTIONARY of env is not of type 'string' or does not conform to the format '$(VARNAME)'.
[2021-06-11 15:30:35: ERROR] The value '{'type': 'csv', 'csv_file': 'out_reaction_only.csv', 'row_headers': False}' in field variables.SAMPLE_DICTIONARY of env is not of type 'string' or does not conform to the format '$(VARNAME)'.
crkrenn commented 3 years ago

The following is a workaround...

    def verify_environment(self, schema):
        """Verify that the environment in a specification is valid."""
        # validate environment against json schema
        pass
FrankD412 commented 3 years ago

@crkrenn -- I'll have to go take a deeper look, it's not 100% clear what's going on here. What I can gleam is that you're getting a dictionary value for a variable which the validation checker doesn't like. I'll take a look soon.