Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/abinit/abipy into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrunin committed Dec 1, 2023
2 parents 3e58a88 + f2f10a1 commit 1e63d39
Show file tree
Hide file tree
Showing 19 changed files with 1,075 additions and 116 deletions.
25 changes: 6 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ in the form of pre-compiled packages that can be easily installed with e.g.::

Create a new conda_ environment (let's call it ``abienv``) with::

conda create --name abienv
conda create --name abienv python=3.11

and activate it with::

Expand All @@ -106,7 +106,10 @@ in the `anaconda howto <http://abinit.github.io/abipy/installation#anaconda-howt
Developmental version
---------------------

Getting the developmental version of AbiPy is easy.
To install the developmental version of AbiPy with pip, use::

pip install git+https://github.com/abinit/abipy.git@develop

Clone the `github repository <https://github.com/abinit/abipy>`_ with::

git clone https://github.com/abinit/abipy
Expand All @@ -118,7 +121,7 @@ For pip, use::

If you are using conda_ (see `Installing conda`_ to install conda itself), create a new environment (``abienv``) with::

conda create -n abienv
conda create -n abienv python=3.11
source activate abienv

Add ``conda-forge``, and ``abinit`` to your channels with::
Expand All @@ -143,22 +146,6 @@ or alternately::
to install the package in developmental mode.
This is the recommended approach, especially if you are planning to implement new features.

Note, however, that the developmental version of AbiPy is kept in sync with the
developmental version of pymatgen thus ```python setup.py develop``` may
try to download new versions from the PyPi portal and then fail with e.g. the error message::

...
processing dependencies for abipy==0.6.0.dev0
error: scipy 1.0.0 is installed but scipy>=1.0.1 is required by {'pymatgen'}

due to inconsistent dependencies.
To solve the problem, use conda to update scipy to a version >= 1.0.1 with::

conda install "scipy>=1.0.1"

then issue again python setup.py develop. If this fails, supposing you were upgrading abipy inside
an already existing conda environment, try to restart by creating from scratch a fresh conda environment, see above.

Also note that the BLAS/Lapack libraries provided by conda have multithreading support activated by default.
Each process will try to use all of the cores on your machine, which quickly overloads things
if there are multiple processes running.
Expand Down
38 changes: 6 additions & 32 deletions abipy/abio/robots.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,36 +817,6 @@ def close(self) -> None:
print("Exception while closing: ", abifile.filepath)
print(exc)

#@classmethod
#def open(cls, obj, nids=None, **kwargs):
# """
# Flexible constructor. obj can be a :class:`Flow` or a string with the directory containing the Flow.
# `nids` is an optional list of :class:`Node` identifiers used to filter the set of :class:`Task` in the Flow.
# """
# has_dirpath = False
# if is_string(obj):
# try:
# from abipy.flowtk import Flow
# obj = Flow.pickle_load(obj)
# except:
# has_dirpath = True

# if not has_dirpath:
# # We have a Flow. smeth is the name of the Task method used to open the file.
# items = []
# smeth = "open_" + cls.EXT.lower()
# for task in obj.iflat_tasks(nids=nids): #, status=obj.S_OK):
# open_method = getattr(task, smeth, None)
# if open_method is None: continue
# abifile = open_method()
# if abifile is not None: items.append((task.pos_str, abifile))
# return cls(*items)

# else:
# # directory --> search for files with the appropriate extension and open it with abiopen.
# if nids is not None: raise ValueError("nids cannot be used when obj is a directory.")
# return cls.from_dir(obj)

#def get_attributes(self, attr_name, obj=None, retdict=False):
# od = OrderedDict()
# for label, abifile in self.items():
Expand Down Expand Up @@ -1241,10 +1211,14 @@ def get_baserobot_code_cells(self, title=None) -> list:
@staticmethod
def get_yvals_item_abifiles(item: Any, abifiles: list) -> np.ndarray:
"""Extract values for a list of Abinit files."""
def _float(obj):
if obj is None: return obj
return float(obj)

if callable(item):
return np.array([float(item(a)) for a in abifiles])
return np.array([_float(item(a)) for a in abifiles])
else:
return np.array([float(duck.getattrd(a, item)) for a in abifiles])
return np.array([_float(duck.getattrd(a, item)) for a in abifiles])

@staticmethod
def plot_xvals_or_xstr_ax(ax, xs, yvals, fontsize, **kwargs) -> list:
Expand Down
2 changes: 1 addition & 1 deletion abipy/electrons/ebands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3933,7 +3933,7 @@ def boxplot(self, e0="fermie", brange=None, swarm=False, fontsize=8, **kwargs) -
ax_list, fig, plt = get_axarray_fig_plt(None, nrows=nrows, ncols=ncols,
sharex=False, sharey=True, squeeze=False)
ax_list = ax_list.ravel()
# don't show the last ax if numeb is odd.
# don't show the last ax if num_plots is odd.
if num_plots % ncols != 0: ax_list[-1].axis("off")

for (label, ebands), ax in zip(self.ebands_dict.items(), ax_list):
Expand Down
1 change: 1 addition & 0 deletions abipy/electrons/gwr.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
class _MyQpkindsList(list):
"""Returned by find_qpkinds."""


@dataclasses.dataclass
class MinimaxMesh:
"""
Expand Down
Loading

0 comments on commit 1e63d39

Please sign in to comment.