-
Notifications
You must be signed in to change notification settings - Fork 10
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
Minor improvements #44
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vchuravy
reviewed
Jun 24, 2024
@@ -101,18 +114,38 @@ function check(lmp::LMP) | |||
# TODO: Check err == 1 or err == 2 (MPI) | |||
buf = zeros(UInt8, 100) | |||
API.lammps_get_last_error_message(lmp, buf, length(buf)) | |||
error(String(buf)) | |||
error(rstrip(String(buf), '\0')) |
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.
Maybe we can use some of the improvements in #34
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.
Should I revert this then?
vchuravy
approved these changes
Jun 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've added two API functions i've deemed usefull for my usecase. I think these will come in handy for anyone else using this Library.
While I was at it, I've also updated the documentation on
command()
and changed how it handles newline characters.While this is technically a breaking change, I think that this should be fine, as most people probably don't have newlines in their command strings anyways. Doing it this way makes it a lot easier to work with the
command()
function I think...I've also exported
close!()
and made sure thatLMP(f,...)
callsclose!
on the LAMMPS instance as that's what you'd expect to happen when using this variant of the constructor.