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

Analysis attributes are None when they shouldn't be #45

Closed
3 of 6 tasks
thclark opened this issue Dec 16, 2020 · 8 comments · Fixed by #51
Closed
3 of 6 tasks

Analysis attributes are None when they shouldn't be #45

thclark opened this issue Dec 16, 2020 · 8 comments · Fixed by #51
Assignees
Labels
bug Unintended behaviour in any area of the app documentation Improvements or additions to documentation

Comments

@thclark
Copy link
Contributor

thclark commented Dec 16, 2020

I'm submitting a ...

  • support request
  • bug report
  • feature request

Please fill out the relevant sections below.


Bug report

What is the current behavior?

analysis.input_dir is None
>>> True
analysis.data_dir is None
>>> True
analysis.output_dir is None
>>> True
output_manifest is None
>>> True

What is the expected behavior?

  • Analysis *_dir attributes should be either not available or should be not None (i.e. correct)
  • Where a twine file has an output_manifest strand, the output manifest should be pre-created.
  • There should be an example of their use in either the documentation of the demo apps

Other information

@time-trader please could you attach the twine file for this case that we discussed this afternoon?

@thclark thclark added the bug Unintended behaviour in any area of the app label Dec 16, 2020
@thclark thclark added this to Triage in Twined Ecosystem Roadmap via automation Dec 16, 2020
@thclark thclark moved this from Triage to Twined v0.0.x in Twined Ecosystem Roadmap Dec 16, 2020
@thclark thclark changed the title Aanalysis attributes are None when they shouldn't be Analysis attributes are None when they shouldn't be Dec 16, 2020
@thclark thclark added the documentation Improvements or additions to documentation label Dec 16, 2020
@thclark thclark moved this from Soon to Highest Priority in Twined Ecosystem Roadmap Dec 16, 2020
@cortadocodes
Copy link
Member

@time-trader I think I've fixed this but please send me your Twine file and a minimal amount of code that reproduces the issue so I can make sure.

@cortadocodes
Copy link
Member

@thclark I'm not sure the second and third tickboxes are related to this issue now?

@thclark
Copy link
Contributor Author

thclark commented Dec 16, 2020

@thclark I'm not sure the second and third tickboxes are related to this issue now?

Can you make a test where twine file specifies an output manifest, then assert that the value of output_manifest is not none in run()?

On the documentation, this seems like a weird place to start so happy with skipping that. Although I have a strong feeling we should actually deprecate input_dir on the analysis object to dissuade people from using it. It's best to use the path property on the Dataset (which is a Pathable) in question (that way we can ultimately allow datasets to reside in different locations)

@cortadocodes
Copy link
Member

@cortadocodes
Copy link
Member

cortadocodes commented Dec 18, 2020

@time-trader I think one part of the problem is a typo in the output_manifest key - there shouldn't be a : at the end. This is what's in your twine file currently:

  "output_manifest:": [
    {
      "key": "open_foam_result",
      "purpose": "A dataset containing solution fields of an openfoam case."
    },
    {
      "key": "airfoil_cp_values",
      "purpose": "A file containing cp values"
    }
  ]

@cortadocodes
Copy link
Member

cortadocodes commented Dec 18, 2020

@thclark the other problem appears to be in the Runner._update_manifest_path method:

@staticmethod
def _update_manifest_path((manifest, pathname):
    if manifest is not None and hasattr(pathname, "endswith"):
        if pathname.endswith(".json"):
            manifest.path = os.path.split(pathname)[0]

        # Otherwise do nothing and rely on manifest having its path variable set already
        return manifest

This returns None if the pathname is None, erasing the manifest if it exists.

I might be lacking some context here, but it seems incorrect that a Manifest can have a path at the same time as the output_manifest_path argument of the Runner.run method is None.

@time-trader
Copy link

time-trader commented Dec 18, 2020

@time-trader I think one part of the problem is a typo in the output_manifest key - there shouldn't be a : at the end. This is what's in your twine file currently:

  "output_manifest:": [
    {
      "key": "open_foam_result",
      "purpose": "A dataset containing solution fields of an openfoam case."
    },
    {
      "key": "airfoil_cp_values",
      "purpose": "A file containing cp values"
    }
  ]

@cortadocodes Yes. That was a problem. I will go cry in the corner for not noticing that ":"

@cortadocodes cortadocodes mentioned this issue Dec 18, 2020
5 tasks
Twined Ecosystem Roadmap automation moved this from Highest Priority to Done Dec 18, 2020
@thclark
Copy link
Contributor Author

thclark commented Dec 18, 2020

@time-trader please don't cry. If you promise not to cry we'll promise to move octue/twined#16 up the priority board to prevent exactly this scenario from happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended behaviour in any area of the app documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants