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

available vs generated data #29

Merged
merged 10 commits into from
Oct 29, 2024
Merged

available vs generated data #29

merged 10 commits into from
Oct 29, 2024

Conversation

leclairm
Copy link
Contributor

No description provided.

@leclairm leclairm requested a review from GeigerJ2 October 28, 2024 08:02
@leclairm leclairm linked an issue Oct 28, 2024 that may be closed by this pull request
@leclairm leclairm requested review from agoscinski and removed request for GeigerJ2 October 28, 2024 08:04
Copy link
Collaborator

@GeigerJ2 GeigerJ2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, @leclairm! Looks fine to me. Just added one minor comment.

In addition, I think we should still have a way to denote if a data entry lives on the local machine, irrespective if it's available or generated. It could be via type='remote', even though, one then loses the file/dir specification for the type. However, as I mentioned in my comment in issue #28, this actually doesn't matter for AiiDA, and I'm not sure if we really use the information somewhere else in the code. I further assume generated would basically always be on the remote HPC?

As this isn't addressed in this PR, I'll work on it locally (and have already been), and will open another PR.

@leclairm
Copy link
Contributor Author

Thank you for the PR, @leclairm! Looks fine to me. Just added one minor comment.

In addition, I think we should still have a way to denote if a data entry lives on the local machine, irrespective if it's available or generated. It could be via type='remote', even though, one then loses the file/dir specification for the type. However, as I mentioned in my comment in issue #28, this actually doesn't matter for AiiDA, and I'm not sure if we really use the information somewhere else in the code. I further assume generated would basically always be on the remote HPC?

As this isn't addressed in this PR, I'll work on it locally (and have already been), and will open another PR.

Yes, let's keep that for the separate discussion.

@leclairm
Copy link
Contributor Author

@agoscinski you can check if everything is fine now.

Copy link
Collaborator

@agoscinski agoscinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also adapt the test_config_small.yml? Most formatting issues should be fixed automatically with hatch fmt.

@leclairm
Copy link
Contributor Author

Can you also adapt the test_config_small.yml? Most formatting issues should be fixed automatically with hatch fmt.

What is ruff trying to tell me with this?

src/wcflow/core.py:27:9: FBT001 Boolean-typed positional argument in function definition
src/wcflow/core.py:102:9: FBT001 Boolean-typed positional argument in function definition
src/wcflow/core.py:161:9: FBT001 Boolean-typed positional argument in function definition

@agoscinski
Copy link
Collaborator

You can always look up the code FBT001 online and find more explanations. Then you find such a page https://docs.astral.sh/ruff/rules/boolean-type-hint-positional-argument/
I think the arguments on the page are fair. Would make it also enforce keyword argument usage by changing to

    def __init__(
        self,
        name: str,
        type: str,  # noqa: A002
        src: str,
        lag: list[Duration],
        date: list[datetime],
        arg_option: str | None,
        *
        available: bool,
    ):

I actually thought at some point to enforce keyword argument usage to every input argument to increase readability. But that we can do another time.

@leclairm
Copy link
Contributor Author

Can you also adapt the test_config_small.yml? Most formatting issues should be fixed automatically with hatch fmt.

done

@leclairm
Copy link
Contributor Author

You can always look up the code FBT001 online and find more explanations. Then you find such a page https://docs.astral.sh/ruff/rules/boolean-type-hint-positional-argument/ I think the arguments on the page are fair. Would make it also enforce keyword argument usage by changing to

    def __init__(
        self,
        name: str,
        type: str,  # noqa: A002
        src: str,
        lag: list[Duration],
        date: list[datetime],
        arg_option: str | None,
        *
        available: bool,
    ):

I actually thought at some point to enforce keyword argument usage to every input argument to increase readability. But that we can do another time.

did it for avaialble

Copy link
Collaborator

@agoscinski agoscinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank for the work. Could you squash merge with a commit message like this?

Introduce keywords that distinguish data that is available on init and not in yml file (#29)

We introduce the keywords `available` and `generated` in the yml file that
specify if the data exists already on initialization or is generated by the
workflow. Before that we needed to refer this from how the data is used in the
workflow. We decided to let the user specify this for better error control
handling. Implements suggestion from issue #28

@leclairm leclairm merged commit 5f942f8 into main Oct 29, 2024
3 checks passed
@agoscinski agoscinski deleted the fix_abs_data branch October 29, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

workflow input data
3 participants