Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation of input and sheet_music testing #364

Open
crkrenn opened this issue Jun 11, 2021 · 2 comments
Open

validation of input and sheet_music testing #364

crkrenn opened this issue Jun 11, 2021 · 2 comments
Labels
bug Description of reproducible unexpected behavior.

Comments

@crkrenn
Copy link
Contributor

crkrenn commented Jun 11, 2021

@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
Copy link
Contributor Author

crkrenn commented Jun 11, 2021

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 FrankD412 added the bug Description of reproducible unexpected behavior. label Jun 16, 2021
@FrankD412
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Description of reproducible unexpected behavior.
Projects
None yet
Development

No branches or pull requests

2 participants