Skip to content

Collected small fixes and updates #4599

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

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

akohlmey
Copy link
Member

@akohlmey akohlmey commented May 21, 2025

Summary

This pull request combines multiple small fixes and corrections.

Related Issue(s)

N/A

Author(s)

Axel Kohlmeyer, Temple U, akohlmey@gmail.com
Jacob Tavenner, NASA Ames Research Center, tavennerjacob@gmail.com

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

N/A

Implementation Notes

The following individual changes are included:

  • let utils::expand_args() stop with a descriptive error message, when a vector-style variable reference is provided with a wildcard without the required upper boundary
  • refactor fix neighbor/swap for improved errors and modernized C++ code
  • fix argument indexing bug in fix neighbor/swap
  • small documentation updates
  • add example inputs for fix neighbor/swap

Post Submission Checklist

  • The feature or features in this pull request is complete
  • Licensing information is complete
  • Corresponding author information is complete
  • The source code follows the LAMMPS formatting guidelines
  • Suitable new documentation files and/or updates to the existing docs are included
  • The added/updated documentation is integrated and tested with the documentation build system
  • The feature has been verified to work with the conventional build system
  • The feature has been verified to work with the CMake based build system
  • Suitable tests have been added to the unittest tree.
  • A package specific README file has been included or updated
  • One or more example input decks are included

Further Information, Files, and Links

N/A

akohlmey added 2 commits May 20, 2025 21:49
- plug memory leak
- modernize access to computes
- tighten checks
- modernize and improve error messages
- better check for known keywords when processing atom types
- support for typelabels
@akohlmey akohlmey requested a review from Copilot May 21, 2025 11:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request combines multiple small fixes and updates, including improved error handling for vector-style variable expansion, refactoring of the neighbor/swap fix for clearer errors and modernized C++ usage, and minor documentation improvements.

  • Update of error reporting in utils::expand_args() with a descriptive message when a vector variable is missing an upper bound.
  • Refactoring of the neighbor/swap fix (both header and source) to modernize code and improve error messaging.
  • Revision of unit tests and documentation for consistency with these changes.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
unittest/cplusplus/test_advanced_utils.cpp Adjusted expected error messages and argument count in tests
src/utils.cpp Updated error reporting parameters for consistency
src/MC/fix_neighbor_swap.h Minor renaming and removal of unused code/comments
src/MC/fix_neighbor_swap.cpp Enhancements to error messages, parameter validation, and swap probability computation using modern C++ patterns
doc/src/fix_ave_correlate_long.rst Documentation tweaks to clarify wildcard usage in variable expressions
Comments suppressed due to low confidence (2)

unittest/cplusplus/test_advanced_utils.cpp:223

  • Verify that the updated expected argument count of 14 correctly reflects the intended behavior after the modification in upper-bound error handling.
EXPECT_EQ(narg, 14);

doc/src/fix_ave_correlate_long.rst:85

  • [nitpick] Ensure that the updated terminology ('wildcard string') is consistently used throughout the documentation to avoid potential confusion.
evaluation of an equal-style or vector-style variable.  The specified indices can include a wildcard string.

Copy link
Member Author

@akohlmey akohlmey left a comment

Choose a reason for hiding this comment

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

@jtavenner-dev I had to do some significant refactoring of your contributed code to modernize some parts and have it better aligned with current programming conventions. Also, a couple minor bugs were fixed and I added support for type labels.

Unfortunately, I could not find an example input in the examples tree, so this is currently untested. Can you have a closer look and - ideally - provide some small, simple examples so that I can check as well.

@jtavenner-dev
Copy link
Contributor

Thanks for the code modernization updates and clearer error handling. I have fixed a minor bug unrelated to your changes regarding reading the options. I've also tested some short example scripts.

However, I'm not sure how to add to this pull request. I've updated the changes to a branch in sync with this pull, but can't seem to push any changes. Not sure if this is just permissions-related or if I'm missing something else.

@akohlmey
Copy link
Member Author

However, I'm not sure how to add to this pull request. I've updated the changes to a branch in sync with this pull, but can't seem to push any changes. Not sure if this is just permissions-related or if I'm missing something else.

You cannot push because you have no write permission for the LAMMPS repository.
Just push it to your fork and let me know the name of the branch and then I can pull it myself.
or create a diff and attach it here.

@jtavenner-dev
Copy link
Contributor

Sounds good. I was trying to push to one of your forked lammps branches, so permissions make sense. I've synced the changes here and my updates to my lammps fork on the 'develop' branch.

@akohlmey
Copy link
Member Author

Sounds good. I was trying to push to one of your forked lammps branches, so permissions make sense. I've synced the changes here and my updates to my lammps fork on the 'develop' branch.

@jtavenner-dev The changes are now integrated. I also moved and renamed the example folder, trimmed the inputs and make them use a potential that we already have included.

@jtavenner-dev
Copy link
Contributor

@jtavenner-dev The changes are now integrated. I also moved and renamed the example folder, trimmed the inputs and make them use a potential that we already have included.

Looks good to me, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy