Skip to content
Open
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ci:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.21
rev: v0.15.22
hooks:
# Run the linter.
- id: ruff
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ formats:
conda:
environment: docs/docs-env.yml
build:
os: ubuntu-20.04
os: ubuntu-24.04
tools:
python: "mambaforge-4.10"
python: "mambaforge-latest"
sphinx:
builder: html
configuration: docs/conf.py
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
# built documents.
#

version = "1.3.0"
release = "1.3.0"
version = "1.4.0"
release = "1.4.0"


# The language for content autogenerated by Sphinx. Refer to documentation
Expand Down
2 changes: 1 addition & 1 deletion mbuild/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from mbuild.port import Port
from mbuild.recipes import recipes

__version__ = "1.3.1"
__version__ = "1.4.0"
__date__ = "2025-11-10"


Expand Down
48 changes: 48 additions & 0 deletions mbuild/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,54 @@ def load_file(
return compound


def from_coxeter(shape, compound=None, ref_length=1, element=None, name=None):
"""Backend-specific loading function for Coxeter.

Vertices are placed as particles and edges become bonds. The shape is
scaled so that its longest edge has length ``ref_length``, independent of
coxeter's native (unit-volume / unit-area) normalization.

Parameters
----------
shape : coxeter.shapes
Any member of coxeter.shapes that exposes ``vertices`` and ``edges``.
compound : mb.Compound, optional, default=None
Host mb.Compound to load into. A new one is created if left as ``None``.
ref_length : float, optional, default=1
Target length of the longest edge, in the compound's units.
element : str, optional, default=None
The element symbol that sets the particle type for the particles.
If None, a generic bead-type is used.
name : str, optional, default="X"
Sets the particle name, but not the element.
Use this instead of ``element`` for non-atomistic particles.
"""
if compound is None:
compound = mb.Compound()

scale = ref_length / shape.edge_lengths.max()

particles = []
for v in shape.vertices:
p = mb.Compound(pos=np.asarray(v) * scale)
if element:
p.element = element_from_symbol(element)
if not name:
p.name = element
else:
p.name = name
elif name:
p.name = name
compound.add(p)
particles.append(p)

for edge in shape.edges:
p1 = particles[int(edge[0])]
p2 = particles[int(edge[1])]
compound.add_bond(particle_pair=(p1, p2))
return compound


def from_parmed(
structure, compound=None, coords_only=False, infer_hierarchy=True, **kwargs
):
Expand Down
18 changes: 9 additions & 9 deletions mbuild/packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,15 +1196,15 @@ def _run_packmol(input_text, filled_xyz, temp_file, packmol_file):
):
shutil.copyfileobj(inp_file, new_file)

proc = Popen(
f"{PACKMOL} < {packmol_inp.name}",
stdin=PIPE,
stdout=PIPE,
stderr=PIPE,
universal_newlines=True,
shell=True,
)
out, err = proc.communicate()
with open(packmol_inp.name) as inp_file:
proc = Popen(
[PACKMOL],
stdin=inp_file,
stdout=PIPE,
stderr=PIPE,
universal_newlines=True,
)
out, err = proc.communicate()

if "WITHOUT PERFECT PACKING" in out:
logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion mbuild/periodic_kdtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def query_ball_point(self, x, r, p=2.0, eps=0):
return self.__query_ball_point(x, r, p, eps)
else:
retshape = x.shape[:-1]
result = np.empty(retshape, dtype=np.object)
result = np.empty(retshape, dtype=object)
for c in np.ndindex(retshape):
result[c] = self.__query_ball_point(x[c], r, p, eps)
return result
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers=[
"Operating System :: MacOS",
]
urls = {Homepage = "https://github.com/mosdef-hub/mbuild"}
requires-python = ">=3.10"
requires-python = ">=3.11"
dynamic = ["version"]

[tool.setuptools]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.3.0
current_version = 1.4.0
commit = True
tag = True
message = Bump to version {new_version}
Expand Down
Loading