diff --git a/docs/Makefile b/docs/Makefile index 6d54f4b53..c83c28f88 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -52,7 +52,7 @@ clean: rm -rf $(BUILDDIR)/* html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXBUILD) --show-traceback -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/docs/conf.py b/docs/conf.py index 21d773218..36e663587 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -284,7 +284,8 @@ # Raise Error (not default Warning) when a notebook execution fails # (due to code error, timeout, etc.) nb_execution_raise_on_error = True -nb_execution_timeout = 60 +nb_execution_show_tb = True +nb_execution_timeout = 90 # -- Extension configuration ------------------------------------------------- diff --git a/matscipy/calculators/eam/io.py b/matscipy/calculators/eam/io.py index 2621c3cf0..94b4909c2 100644 --- a/matscipy/calculators/eam/io.py +++ b/matscipy/calculators/eam/io.py @@ -148,11 +148,11 @@ def read_eam(eam_file, kind="eam/alloy"): supported_kinds = ["eam", "eam/alloy", "eam/fs"] if kind not in supported_kinds: raise ValueError(f"EAM kind {kind} not supported") - with open(eam_file, 'r') as file: - eam = file.readlines() + # with open(eam_file, 'r', encoding='utf-8') as file: + # eam = file.readlines() if kind == "eam": - with open(eam_file, 'r') as file: + with open(eam_file, 'r', encoding='utf-8') as file: # ignore comment characters on first line but strip them from subsequent lines lines = [file.readline()] lines.extend(_strip_comments_from_line(line) for line in file.readlines()) @@ -216,7 +216,7 @@ def read_eam(eam_file, kind="eam/alloy"): if kind in ["eam/alloy", "eam/fs"]: """eam/alloy and eam/fs have almost the same structure, except for the electron density section""" - with open(eam_file, 'r') as file: + with open(eam_file, 'r', encoding='utf-8') as file: # ignore comment characters on first line but strip them from subsequent lines lines = [file.readline() for _ in range(3)] lines.extend(_strip_comments_from_line(line) for line in file.readlines()) diff --git a/matscipy/dislocation.py b/matscipy/dislocation.py index b9c39ee1f..d77fdfdfb 100644 --- a/matscipy/dislocation.py +++ b/matscipy/dislocation.py @@ -3493,6 +3493,7 @@ def inf_line_transform(p, z_max): # Start by translating by z_max (periodicity) such that there are points below the cell n = np.ceil(np.min(p[:, 2]) / z_max) p_off = n * z_max + p = np.copy(p) # Needed as sphinx-build/myst_nb was making `p` read-only for some reason. p[:, 2] -= p_off # Now start from the point with negative z closest to z=0 @@ -4064,7 +4065,7 @@ def build_cylinder(self, bulk, disloc, core_positions, cyl_mask, fix_mask = self._build_bulk_cyl(radius, core_positions, fix_width, extension, fixed_points, self_consistent, method, verbose, cyl_mask=cyl_mask, **kwargs) - if partial_distance > 0: + if not np.allclose(core_positions[0, :], core_positions[1, :]): # Specify left & right dislocation separately disloc.info["core_positions"] = [list(core_positions[0, :]), list(core_positions[1, :])] disloc.info["burgers_vectors"] = [list(self.left_dislocation.burgers), list(self.right_dislocation.burgers)] diff --git a/pyproject.toml b/pyproject.toml index 3bf49b219..74f87412f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ requires-python = ">=3.8.0" dynamic = ["version"] dependencies = [ - "numpy>=1.16.0", + "numpy>=1.16.0, <2.0.0", "scipy>=1.2.3", "ase>=3.23.0", "packaging" @@ -35,22 +35,24 @@ test = [ "pytest", "pytest-subtests", "pytest-timeout", - "sympy", - "atomman", - "ovito" + "matscipy[dislocation]", + "sympy" +] +dislocation = [ + "nglview==3.0.8", # resolves https://github.com/libAtoms/matscipy/issues/222 + "ovito", + "atomman" ] docs = [ + "matscipy[dislocation]", "sphinx", "myst_nb", "numpydoc", - "atomman", - "ovito", "sphinx_copybutton", "sphinx_rtd_theme", "sphinxcontrib-spelling", "pydata-sphinx-theme", - "jupytext", - "nglview==3.0.8" # resolves https://github.com/libAtoms/matscipy/issues/222 + "jupytext" ] cli = [ "argcomplete"