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

Templatereplacer parser make more general #5669

Merged
merged 5 commits into from
Sep 27, 2022

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Sep 26, 2022

The TemplatereplacerParser is general enough which I am going to use for the nightly test of portable containerized code. here I clean up the outdated docstring and move it out from doubler.

@sphuber
Copy link
Contributor

sphuber commented Sep 27, 2022

f-me

Are you swearing in your commit messages? 😄

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

I guess that we are technically breaking functionality here, given that this is a public plugin. Then again, I agree that having such a specific implementation that is just being used for a test-case that doubles a number, seems silly. I doubt that anyone out there is using this other than for testing (but still unlikely), in which case I think it is acceptable to break that. So I'd be ok with merging this. Just one change to address.

@@ -69,13 +69,13 @@ def parse(self, **kwargs):

@staticmethod
def parse_stdout(filelike):
"""Parse the sum from the output of the ArithmeticAddcalculation written to standard out.
"""Parse the content from the output of the TemplatereplacerCalculation written to output file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that we no longer need the try/catch in this method. The ValueError was being caught in case the output could not be cast to an integer. So really this method should just do return filelike.read() but that is ridiculous, so might as well get rid of the method entirely and just change line 32 to

result = handle.read()

and be done with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Changed.

@unkcpz
Copy link
Member Author

unkcpz commented Sep 27, 2022

@sphuber thanks a lot!

f-me

Are you swearing in your commit messages? 😄

Haha, "f-me" for "Fix by myself", and "r-seb" for "Review and advised by Sebastiaan". Sorry for this, I know it is not a good habit to do such simple and ridiculous commit messages, but sometimes it is harder to write meaningful commit messages than fix bugs.

I doubt that anyone out there is using this other than for testing (but still unlikely)

I guess you mean the parser? I actually use this templatereplacer calculation plugin for the prototype of some quick implementation.

@unkcpz unkcpz requested a review from sphuber September 27, 2022 16:28
@sphuber
Copy link
Contributor

sphuber commented Sep 27, 2022

Haha, "f-me" for "Fix by myself", and "r-seb" for "Review and advised by Sebastiaan". Sorry for this, I know it is not a good habit to do such simple and ridiculous commit messages, but sometimes it is harder to write meaningful commit messages than fix bugs.

No problem whatsoever, just found it funny because it looked like a "fuck me, again a small fix to make the pre-commit pass" or something like that 😄

I guess you mean the parser? I actually use this templatereplacer calculation plugin for the prototype of some quick implementation.

Both, but mostly the parsers, as that was really specific to a code even that would just double an input. Clearly only useful for such a test case.

@sphuber sphuber merged commit 3416ba6 into aiidateam:main Sep 27, 2022
@unkcpz unkcpz deleted the rename/templateplacer-parser branch September 28, 2022 08:58
@unkcpz
Copy link
Member Author

unkcpz commented Sep 28, 2022

"fuck me, again a small fix to make the pre-commit pass"

It is a good explanation, I may keep on using it with this. 🤪

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.

2 participants