Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

PR: Lattice attributes are always 3D.#147

Merged
roigcarlo merged 2 commits into
masterfrom
lattice_always_in_3D
May 18, 2015
Merged

PR: Lattice attributes are always 3D.#147
roigcarlo merged 2 commits into
masterfrom
lattice_always_in_3D

Conversation

@tuopuu

@tuopuu tuopuu commented May 14, 2015

Copy link
Copy Markdown
Contributor

This PR fixed #80. Please, note that documentation is not modified yet.

Changes:
abstractlattice.py:

  • replaced "D x " notation with [3] in docstrings

lattice.py:

  • replaced "D x " notation with [3] in docstrings
  • factory functions always create 3D Lattices. 2D lattice is embedded on the XY-plane in 3D. This is due to decision by the SSB that the 3rd coordinate is ignored for 2D lattices.
  • factory functions still require correct dimensions for lattice parameters, e.g. two dimensions for the size of 2D lattice.

test_lattice.py:

  • changed all 2D variables to 3D except in factory functions by adding 0 or 1

h5lattice.py:

  • replaced "D x " notation with [3] in docstrings

abc_check_lattice.py:

  • tests for 2D-lattices now use 3D attributes

for size, origin, etc. Factory functions require 2D size, origin etc for
two dimensional lattices. User must _not_ input the extra '1', e.g.
(n,m,1), for the size attribute.
@tuopuu

tuopuu commented May 14, 2015

Copy link
Copy Markdown
Contributor Author

@itziakos, @roigcarlo, @kemattil here's the initial push to fix #80. I think there are several ways to implement the SSB decision. This is the one I thought was the simplest. Please, take a look.

There are no try/exceptions written that test the dimensionality of input parameters, but I think they could be added to the factory functions, at least. Please, let me know if you think that's a good idea to do.

@itziakos

Copy link
Copy Markdown
Contributor

There are no try/exceptions written that test the dimensionality of input parameters, but I think they could be added to the factory functions, at least. Please, let me know if you think that's a good idea to do.

I am in favor of not overdoing it also.

Comment thread simphony/cuds/lattice.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think origin should be x, y, z

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right. Docstrings already say that the lattice will be embedded in 3D so the origin must be in 3D.

@tuopuu tuopuu changed the title PR [WIP]: Lattice attributes are always 3D. PR: Lattice attributes are always 3D. May 15, 2015
roigcarlo added a commit that referenced this pull request May 18, 2015
PR: Lattice attributes are always 3D.
@roigcarlo roigcarlo merged commit bdbcf72 into master May 18, 2015
@roigcarlo roigcarlo deleted the lattice_always_in_3D branch May 18, 2015 08:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CUDS: Lattice size, origin and base_vectors should be always in 3D

4 participants