From ba3edbc69dc440f22fdeb96185a465b1a6beeb8a Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 1 May 2020 15:56:37 -0400 Subject: [PATCH 1/6] Clarify conditional statement Co-authored-by: Erik Everson --- plasmapy_nei/eigen/eigenclass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plasmapy_nei/eigen/eigenclass.py b/plasmapy_nei/eigen/eigenclass.py index 653b1b8..dd591ad 100644 --- a/plasmapy_nei/eigen/eigenclass.py +++ b/plasmapy_nei/eigen/eigenclass.py @@ -304,7 +304,7 @@ def eigenvalues(self, T_e=None, T_e_index=None): Returns the eigenvalues for the ionization and recombination rates for the temperature specified in the class. """ - if T_e_index: + if T_e_index is not None: return self._eigenvalues[T_e_index, :] elif T_e: T_e_index = self._get_temperature_index(T_e) From 89ee09a674b2d7c0e152094281a4b8ae703822ab Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 1 May 2020 15:57:31 -0400 Subject: [PATCH 2/6] Add PlasmaPy to intersphinx mapping Co-authored-by: Erik Everson --- docs/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index e735f81..beb1dfb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,7 +60,9 @@ 'numpy': ('https://docs.scipy.org/doc/numpy', None), 'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None), 'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None), - 'astropy': ('http://docs.astropy.org/en/stable/', None)} + 'astropy': ('http://docs.astropy.org/en/stable/', None), + 'plasmapy': ('http://docs.plasmapy.org/en/latest/', None), +} # -- Options for HTML output ------------------------------------------------- From 3133cfff6b7cb35daa282d14c38a9c4ec43f3ca6 Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 1 May 2020 16:20:50 -0400 Subject: [PATCH 3/6] Use `size` attribute instead of calling `len` Co-authored-by: Erik Everson --- plasmapy_nei/eigen/eigenclass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plasmapy_nei/eigen/eigenclass.py b/plasmapy_nei/eigen/eigenclass.py index dd591ad..a252918 100644 --- a/plasmapy_nei/eigen/eigenclass.py +++ b/plasmapy_nei/eigen/eigenclass.py @@ -115,7 +115,7 @@ def _load_data(self): with h5py.File(filename, "r") as file: self._temperature_grid = file["te_gird"][:] # TODO: fix typo in HDF5 file - self._ntemp = len(self.temperature_grid) + self._ntemp = self._temperature_grid.size c_ori = file["ioniz_rate"][:] r_ori = file["recomb_rate"][:] From c3e49fbae31b5d96de67a14afaa3e1f840ead7b0 Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 1 May 2020 16:26:46 -0400 Subject: [PATCH 4/6] Specify minimum package versions Co-authored-by: Erik Everson --- setup.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index e261197..91712e5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,9 +15,10 @@ python_requires = >=3.7 setup_requires = setuptools_scm install_requires = - astropy - plasmapy + astropy>=3.2 h5py + numpy>=1.16 + plasmapy>=0.3.1 [options.entry_points] @@ -120,4 +121,3 @@ max-line-length = 88 line_length=88 multi_line_output=3 include_trailing_comma: True - From 1b7460e6d13650c594c3bdb1cc8c7dcea9877b9b Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 1 May 2020 16:30:49 -0400 Subject: [PATCH 5/6] Be more specific in a conditional Co-authored-by: Erik Everson --- plasmapy_nei/eigen/eigenclass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plasmapy_nei/eigen/eigenclass.py b/plasmapy_nei/eigen/eigenclass.py index a252918..4242caf 100644 --- a/plasmapy_nei/eigen/eigenclass.py +++ b/plasmapy_nei/eigen/eigenclass.py @@ -306,7 +306,7 @@ def eigenvalues(self, T_e=None, T_e_index=None): """ if T_e_index is not None: return self._eigenvalues[T_e_index, :] - elif T_e: + elif T_e is not None: T_e_index = self._get_temperature_index(T_e) return self._eigenvalues[T_e_index, :] elif self.temperature: From 8bb9cabc7e3843b007fe623a88f3eb1b5df92773 Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Fri, 1 May 2020 16:31:56 -0400 Subject: [PATCH 6/6] Remove install_requires in setup.py This should be handled by within setup.cfg. Co-authored-by: Erik Everson --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 6fdd635..655bdf8 100755 --- a/setup.py +++ b/setup.py @@ -20,6 +20,5 @@ "write_to": os.path.join("plasmapy_nei", "version.py"), "write_to_template": VERSION_TEMPLATE, }, - install_requires=["plasmapy>=0.3.1", "numpy>=1.16", "astropy>=3.2", "h5py"], include_package_data=True, )