Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
CalCraven opened this issue Oct 8, 2024 · 0 comments

Comments

@CalCraven
Copy link
Contributor

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant