Skip to content

I think the mb.pattern.Pattern.apply method is not well tested or documented. #1202

@CalCraven

Description

@CalCraven

Bug summary

What were you trying to do and what happened instead? Please copy and paste the stack output
I was trying to take a Random2DPattern of points, and place copies of my compounds across this pattern in an orientation specified by the "up" port.

In general, I see no tests in test_pattern.py, and the documentation is lacking for some of these older functions. Might be handy to do a quick update on them, or add this feature so the orientation can be more easily set.

Code to reproduce the behavior

Please include a code snippet that can be used to reproduce this bug.

from mbuild.pattern import Random2DPattern
from mbuild.lib.atoms import H, C3

test_particle = C3()
pattern = Random2DPattern(100, seed=1, orientations={"up":[test_particle]}, scale=10) # I would like this to orient in the [0,0,1] direction.
cpd = H()
cpds = pattern.apply(cpd, orientation="up", compound_port="up")
top_cpd = mb.Compound()
top_cpd.add(cpds)
top_cpd.visualize()

Software versions

  • Which version of mBuild are you using? (python -c "import mbuild as mb; print(mb.__version__)")
    0.18.0
  • Which version of Python (python --version)?
    3.9
  • Which operating system?
    MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions