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

Fixing group functionality #50

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions aiida_lammps/common/input_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,7 @@ def generate_input_file(
control_block = write_control_block(
parameters_control=parameters.get("control", {})
)
# Generate the compute input block
if "compute" in parameters:
compute_block = write_compute_block(
parameters_compute=parameters.get("compute", {})
)
else:
compute_block = ""

# Generate the thermo input block
thermo_block, fixed_thermo = write_thermo_block(
parameters_thermo=parameters.get("thermo", {}),
Expand Down Expand Up @@ -121,6 +115,13 @@ def generate_input_file(
)
else:
fix_block = ""
# Generate the compute input block
if "compute" in parameters:
compute_block = write_compute_block(
parameters_compute=parameters.get("compute", {}), group_names=group_lists
)
else:
compute_block = ""
# Generate the potential input block
potential_block = write_potential_block(
parameters_potential=parameters.get("potential", {}),
Expand Down Expand Up @@ -325,7 +326,7 @@ def write_structure_block(
structure_block += f"read_data {structure_filename}\n"
# Set the groups which will be used for the calculations
if "groups" in parameters_structure:
for _group in parameters_structure["group"]:
for _group in parameters_structure["groups"]:
# Check if the given type name corresponds to the ones assigned to the atom types
if "type" in _group["args"]:

Expand All @@ -344,7 +345,6 @@ def write_structure_block(
f'read_restart {restart_file} {parameters_structure["remap"]}'
)
structure_block += generate_header("End of the Structure information")

return structure_block, group_names


Expand Down Expand Up @@ -511,7 +511,7 @@ def generate_velocity_options(options_velocity: dict) -> str:
:return: string with the velocity options
:rtype: str
"""
_options = ["dist", "sum", "mom" "rot", "temp", "bias", "loop", "rigid", "units"]
_options = ["dist", "sum", "mom", "rot", "temp", "bias", "loop", "rigid", "units"]

velocity_option = ""
for _option in _options:
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/validation/schemas/lammps_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
}
}
},
"required": ["style", "constraints"]
"required": ["style"]
}
}
},
Expand Down