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

Commit

Permalink
Merge pull request #363 from simphony/update-metadata
Browse files Browse the repository at this point in the history
Updates against recent metadata. Fixes a few problems with yapf/setup.py
  • Loading branch information
stefanoborini committed Dec 13, 2016
2 parents 3fa554e + 0912469 commit 22fb68c
Show file tree
Hide file tree
Showing 32 changed files with 183 additions and 78 deletions.
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ coverage
flake8<3
numpy >= 1.4.1
hypothesis
yapf
4 changes: 2 additions & 2 deletions scripts/tests/test_meta_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_Origin(self):

def test_Box(self):
box = meta_class.Box()
arr = box.vector == numpy.array([[0, 0, 0], [0, 0, 0], [0, 0, 0]])
arr = box.vector == numpy.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
self.assertTrue(arr.all())

def test_Berendsen(self):
Expand Down Expand Up @@ -355,5 +355,5 @@ def test_NoseHooverBoundary(self):
def test_not_sharing_mutable(self):
box1 = meta_class.Box()
box2 = meta_class.Box()
box1.vector[0][0] = 1.
box1.vector[0][0] = 3.
self.assertNotEqual(box1.vector[0][0], box2.vector[0][0])
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
exclude = doc/*

[build_meta]
repotag=89797b0d85096c0119cab8ee6dfdf1ed66e6c930
repotag=555be66fc307899a5a9bcd8fe91760f58c487115

7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ def run(self):
print("Failed to run git stash.")
raise

try:
print("Fetching")
check_call(["git", "fetch"])
except CalledProcessError:
print("Failed to fetch")
raise

try:
print("Checking out {}".format(self.repotag))
check_call(["git", "checkout", self.repotag])
Expand Down
8 changes: 1 addition & 7 deletions simphony/core/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,6 @@
key='EXTERNAL_FORCING',
shape=[1],
dtype=bool),
'FACE': Keyword(
name='Face',
definition='A face of a three dimensional object defined by the nodes', # noqa
key='FACE',
shape=[1],
dtype=numpy.float64),
'FINAL': Keyword(
name='Final',
definition='final value of a parameter', # noqa
Expand Down Expand Up @@ -787,7 +781,7 @@
dtype=None),
'BOX': Keyword(
name='Box',
definition='A simple hexahedron (with six faces) simulation box defined by the three vectors and three directions. The condition should be specified for each direction (two faces at a time).', # noqa
definition='A simple hexahedron simulation box defining six boundary faces that are defined by three box vectors. The same boundary condition should be specified for each direction (two faces at a time).', # noqa
key='BOX',
shape=[1],
dtype=None),
Expand Down
10 changes: 8 additions & 2 deletions simphony/cuds/meta/base_centered_monoclinic_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A base centered monoclinic lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -56,5 +62,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.DATA_SET,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
10 changes: 8 additions & 2 deletions simphony/cuds/meta/base_centered_orthorhombic_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A base centered orthorhombic lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -56,5 +62,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.DATA_SET,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
10 changes: 8 additions & 2 deletions simphony/cuds/meta/body_centered_cubic_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A body centred cubic lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -56,5 +62,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.DATA_SET,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
10 changes: 8 additions & 2 deletions simphony/cuds/meta/body_centered_orthorhombic_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A body centered orthorhombic lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -56,5 +62,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.DATA_SET,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
10 changes: 8 additions & 2 deletions simphony/cuds/meta/body_centered_tetragonal_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A body centered tetragonal lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -56,5 +62,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.DATA_SET,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
6 changes: 3 additions & 3 deletions simphony/cuds/meta/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class Box(Boundary):
'''A simple hexahedron (with six faces) simulation box defined by the three vectors and three directions. The condition should be specified for each direction (two faces at a time). # noqa
'''A simple hexahedron simulation box defining six boundary faces that are defined by three box vectors. The same boundary condition should be specified for each direction (two faces at a time). # noqa
'''

cuba_key = CUBA.BOX
Expand All @@ -16,12 +16,12 @@ def __init__(self, description="", name="", condition=None, vector=None):
self._data = DataContainer()

if vector is None:
self.vector = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
self.vector = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
self.condition = condition
self.name = name
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A simple hexahedron (with six faces) simulation box defined by the three vectors and three directions. The condition should be specified for each direction (two faces at a time).' # noqa
self._definition = 'A simple hexahedron simulation box defining six boundary faces that are defined by three box vectors. The same boundary condition should be specified for each direction (two faces at a time).' # noqa

@property
def vector(self):
Expand Down
9 changes: 8 additions & 1 deletion simphony/cuds/meta/bravais_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A Bravais lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def origin(self):
Expand Down Expand Up @@ -88,6 +90,10 @@ def lattice_parameter(self, value):
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -109,4 +115,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.LATTICE, CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
return (CUBA.LATTICE, CUBA.DATA_SET, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
6 changes: 3 additions & 3 deletions simphony/cuds/meta/computational_method.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import uuid
from simphony.core.data_container import DataContainer
from simphony.core.cuba import CUBA
from .cuds_component import CUDSComponent
from .solver_parameter import SolverParameter


class ComputationalMethod(CUDSComponent):
class ComputationalMethod(SolverParameter):
'''A computational method according to the RoMM # noqa
'''

Expand Down Expand Up @@ -49,4 +49,4 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
return (CUBA.SOLVER_PARAMETER, CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
8 changes: 7 additions & 1 deletion simphony/cuds/meta/cubic_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A cubic lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -57,4 +63,4 @@ def supported_parameters(cls):
@classmethod
def parents(cls):
return (CUBA.TETRAGONAL_LATTICE, CUBA.BRAVAIS_LATTICE, CUBA.LATTICE,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
CUBA.DATA_SET, CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
3 changes: 2 additions & 1 deletion simphony/cuds/meta/dem.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.COMPUTATIONAL_METHOD, CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
return (CUBA.COMPUTATIONAL_METHOD, CUBA.SOLVER_PARAMETER,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
10 changes: 8 additions & 2 deletions simphony/cuds/meta/face_centered_cubic_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A face centred cubic lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -56,5 +62,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.DATA_SET,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
10 changes: 8 additions & 2 deletions simphony/cuds/meta/face_centered_orthorhombic_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A face centered orthorhombic lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -56,5 +62,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.DATA_SET,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
3 changes: 2 additions & 1 deletion simphony/cuds/meta/fem.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.COMPUTATIONAL_METHOD, CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
return (CUBA.COMPUTATIONAL_METHOD, CUBA.SOLVER_PARAMETER,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
3 changes: 2 additions & 1 deletion simphony/cuds/meta/fvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.COMPUTATIONAL_METHOD, CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
return (CUBA.COMPUTATIONAL_METHOD, CUBA.SOLVER_PARAMETER,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)
10 changes: 8 additions & 2 deletions simphony/cuds/meta/hexagonal_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ def __init__(self,
self.description = description
# This is a system-managed, read-only attribute
self._definition = 'A hexagonal lattice' # noqa
# This is a system-managed, read-only attribute
self._models = []

@property
def definition(self):
return self._definition

@property
def models(self):
return self._models

@property
def data(self):
return DataContainer(self._data)
Expand All @@ -56,5 +62,5 @@ def supported_parameters(cls):

@classmethod
def parents(cls):
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.CUDS_COMPONENT,
CUBA.CUDS_ITEM)
return (CUBA.BRAVAIS_LATTICE, CUBA.LATTICE, CUBA.DATA_SET,
CUBA.CUDS_COMPONENT, CUBA.CUDS_ITEM)

0 comments on commit 22fb68c

Please sign in to comment.