-
Notifications
You must be signed in to change notification settings - Fork 18
added Input.format_before_coords() and Input.format_after_coords() #155
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
base: main
Are you sure you want to change the base?
Conversation
Please put code snippets into |
| Raises | ||
| ------ | ||
| ValueError | ||
| If the working directory is empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comment to the line where the Exception might be raised.
| Raises | ||
| ------ | ||
| ValueError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add more details. When is this raised?
Can this be raised at every point in the function?
| # --------------------------------- | ||
| # > Block options: After coords | ||
| # --------------------------------- | ||
| if blocks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if can be omitted, as blocks is an empty list, so the for-loop does nothing.
| # --------------------------------- | ||
| # > Block Options: Before coords | ||
| # --------------------------------- | ||
| if blocks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add more details. When is this raised?
Can this be raised at every point in the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify this point a bit more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry.
Looks like I placed the comment on the wrong line.
It's meant to apply to this part here:
Raises
------
ValueError
If the working directory is empty
|
|
||
| assert self.inpfile is not None | ||
| with self.inpfile.open("w") as inp: | ||
| with open(self._inpfile, "w") as inp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you change the open() method?
| for item in arbitrary_strings: | ||
| if item.pos is ArbitraryStringPos.TOP: | ||
| inp.write(f"{item.format_orca()}\n") | ||
| input_string_before_coords = input_param.format_before_coords(self.working_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| input_string_before_coords = input_param.format_before_coords(self.working_dir) | |
| inp.write( | |
| input_param.format_before_coords( | |
| self.working_dir | |
| )) |
| for block in blocks: | ||
| if block.aftercoord: | ||
| inp.write(f"\n{block.format_orca()}\n") | ||
| input_string_after_coords = input_param.format_after_coords() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| input_string_after_coords = input_param.format_after_coords() | |
| inp.write( | |
| input_param.format_after_coords() | |
| ) |
Closes #62
Input.format_before_coords()andInput.format_after_coords(). These methods are then called byCalculator.write_input()