Commit 16528828 authored by dboe's avatar dboe
Browse files

creating parent directories on the fly in save

parent bd811843
Pipeline #84442 passed with stages
in 57 seconds
...@@ -29,7 +29,7 @@ before_script: ...@@ -29,7 +29,7 @@ before_script:
dist: dist:
stage: build stage: build
script: script:
- mkdir -p .ache/apt - mkdir -p .cache/apt
- apt-get update -yqq - apt-get update -yqq
- apt-get install -y gfortran libopenblas-dev liblapack-dev - apt-get install -y gfortran libopenblas-dev liblapack-dev
- apt-get -o dir::cache::archives=".cache/apt" install -y -qq gfortran liblapack-dev libgmp-dev - apt-get -o dir::cache::archives=".cache/apt" install -y -qq gfortran liblapack-dev libgmp-dev
...@@ -76,8 +76,7 @@ test: ...@@ -76,8 +76,7 @@ test:
script: script:
- pip --version - pip --version
- pip install tox # you can also use tox - pip install tox # you can also use tox
- rm -rf .tox - tox
- tox --recreate
coverage: '/^TOTAL.+?(\d+\%)$/' coverage: '/^TOTAL.+?(\d+\%)$/'
artifacts: artifacts:
# paths: # paths:
......
...@@ -81,6 +81,7 @@ class AbstractObject(object): ...@@ -81,6 +81,7 @@ class AbstractObject(object):
) )
path = rna.path.resolve(path) path = rna.path.resolve(path)
rna.path.mkdir(path)
return save_method(path, **kwargs) return save_method(path, **kwargs)
@classmethod @classmethod
...@@ -455,9 +456,7 @@ class AbstractNdarray(np.ndarray, AbstractObject): ...@@ -455,9 +456,7 @@ class AbstractNdarray(np.ndarray, AbstractObject):
Counterpart to __reduce__. Important for unpickling. Counterpart to __reduce__. Important for unpickling.
""" """
# Call the parent's __setstate__ with the other tuple elements. # Call the parent's __setstate__ with the other tuple elements.
super(AbstractNdarray, self).__setstate__( super(AbstractNdarray, self).__setstate__(state[0 : -len(self._iter_slots())])
state[0: -len(self._iter_slots())]
)
# set the __slot__ attributes # set the __slot__ attributes
valid_slot_attrs = list(self._iter_slots()) valid_slot_attrs = list(self._iter_slots())
...@@ -1625,7 +1624,9 @@ find-ordered-vector-in-numpy-array ...@@ -1625,7 +1624,9 @@ find-ordered-vector-in-numpy-array
evalfs = evalfs[idx] evalfs = evalfs[idx]
evecs = evecs[:, idx] evecs = evecs[:, idx]
e = np.concatenate((evecs, evalfs.reshape(1, 3))) e = np.concatenate((evecs, evalfs.reshape(1, 3)))
return e.T.reshape(12,) return e.T.reshape(
12,
)
def main_axes(self, weights=None): def main_axes(self, weights=None):
""" """
...@@ -2321,7 +2322,8 @@ class TensorMaps(TensorFields): ...@@ -2321,7 +2322,8 @@ class TensorMaps(TensorFields):
dim_maps = [dim_maps_dict[dimension][i] for i in range(len(objects))] dim_maps = [dim_maps_dict[dimension][i] for i in range(len(objects))]
return_value = TensorFields.merged( return_value = TensorFields.merged(
*dim_maps, return_templates=return_templates, *dim_maps,
return_templates=return_templates,
) )
if return_templates: if return_templates:
mp, dimension_map_templates = return_value mp, dimension_map_templates = return_value
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment