From ff3b2d195058a9ea8a660218411ad064a0524112 Mon Sep 17 00:00:00 2001 From: cylammarco Date: Wed, 30 Nov 2022 12:21:56 +0200 Subject: [PATCH 1/6] fixed a plotting bug --- src/rascal/plotting.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rascal/plotting.py b/src/rascal/plotting.py index 3761303..656d900 100644 --- a/src/rascal/plotting.py +++ b/src/rascal/plotting.py @@ -990,6 +990,10 @@ def plot_fit( spec_max = np.nanmax(spectrum) * 1.05 + else: + + spec_max = vline_max + fitted_peaks = [] fitted_peaks_adu = [] fitted_diff = [] From 83ceeb881235e912d5fa562ae68318858dc7212b Mon Sep 17 00:00:00 2001 From: cylammarco Date: Thu, 15 Dec 2022 19:45:25 +0200 Subject: [PATCH 2/6] fixed a plotting bug due to wrong indentation --- src/rascal/plotting.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rascal/plotting.py b/src/rascal/plotting.py index 656d900..87d1dab 100644 --- a/src/rascal/plotting.py +++ b/src/rascal/plotting.py @@ -1030,12 +1030,12 @@ def plot_fit( fitted_peaks_adu.append( spectrum[int(calibrator.pix_to_rawpix(p))] ) - fitted_diff.append(diff[idx]) - calibrator.logger.info( - "- matched to {} A".format( - calibrator.atlas.get_lines()[idx] - ) + fitted_diff.append(diff[idx]) + calibrator.logger.info( + "- matched to {} A".format( + calibrator.atlas.get_lines()[idx] ) + ) x_fitted = calibrator.polyval(fitted_peaks, fit_coeff) From c638d85059e54de919bc336d02318c97a643311f Mon Sep 17 00:00:00 2001 From: cylammarco Date: Wed, 11 Jan 2023 17:57:18 +0200 Subject: [PATCH 3/6] Fixed bug that overwrite atlas when trying to append from calibrator. --- src/rascal/calibrator.py | 43 ++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/rascal/calibrator.py b/src/rascal/calibrator.py index 375f8b6..c0dc70e 100644 --- a/src/rascal/calibrator.py +++ b/src/rascal/calibrator.py @@ -1438,19 +1438,36 @@ def add_atlas( max_atlas_wavelength = self.max_wavelength + self.range_tolerance - new_atlas = Atlas( - elements, - min_atlas_wavelength=min_atlas_wavelength, - max_atlas_wavelength=max_atlas_wavelength, - min_intensity=min_intensity, - min_distance=min_distance, - range_tolerance=self.range_tolerance, - vacuum=vacuum, - pressure=pressure, - temperature=temperature, - relative_humidity=relative_humidity, - ) - self.atlas = new_atlas + if self.atlas is None: + + new_atlas = Atlas( + elements, + min_atlas_wavelength=min_atlas_wavelength, + max_atlas_wavelength=max_atlas_wavelength, + min_intensity=min_intensity, + min_distance=min_distance, + range_tolerance=self.range_tolerance, + vacuum=vacuum, + pressure=pressure, + temperature=temperature, + relative_humidity=relative_humidity, + ) + self.atlas = new_atlas + + else: + + self.atlas.add( + elements, + min_atlas_wavelength=min_atlas_wavelength, + max_atlas_wavelength=max_atlas_wavelength, + min_intensity=min_intensity, + min_distance=min_distance, + vacuum=vacuum, + pressure=pressure, + temperature=temperature, + relative_humidity=relative_humidity, + ) + self.candidate_tolerance = candidate_tolerance self.constrain_poly = constrain_poly From d05fac05d64f86501f0aed0066b753f996705a65 Mon Sep 17 00:00:00 2001 From: cylammarco Date: Wed, 11 Jan 2023 18:56:13 +0200 Subject: [PATCH 4/6] fixed fitting error tolerance for perfect fit cases --- .pre-commit-config.yaml | 4 ++-- test/test_effective_pixel.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3e296c..a3cadfc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 22.12.0 hooks: - id: black language_version: python3 @@ -8,7 +8,7 @@ repos: - --line-length=79 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.4.0 hooks: # Identify invalid files - id: check-ast diff --git a/test/test_effective_pixel.py b/test/test_effective_pixel.py index bdd227c..6ac8d41 100644 --- a/test/test_effective_pixel.py +++ b/test/test_effective_pixel.py @@ -44,7 +44,7 @@ def test_providing_effective_pixel_not_affecting_fit(mock_show): range_tolerance=100.0, min_wavelength=100.0, max_wavelength=1300.0 ) - c.set_ransac_properties(linear=False, minimum_fit_error=1e-12) + c.set_ransac_properties(linear=False, minimum_fit_error=1e-14) # Add our fake lines as the atlas a.add_user_atlas(elements=["Test"] * len(waves), wavelengths=waves) From 6fa11fc006cbe08b9e4de94d7ead4d49361d6371 Mon Sep 17 00:00:00 2001 From: cylammarco Date: Wed, 11 Jan 2023 19:12:18 +0200 Subject: [PATCH 5/6] capping numpy to version 1.23.X --- requirements.txt | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index cc11dc7..0407efa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ matplotlib>=3.0.3 -numpy>=1.16 +numpy>=1.16,<1.24 pynverse>=0.1.4 scipy>=1.3.3 tqdm>=4.48.0 diff --git a/setup.cfg b/setup.cfg index 4b24a52..5406e0d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ packages = find: include_package_data = True python_requires = >=3.6 install_requires = - numpy>=1.16 + numpy>=1.16,<1.24 scipy>=1.3.3 pynverse>=0.1.4 matplotlib>=3.0.3 From 4758a61c955757d2fccc7787f14a64961d1bac25 Mon Sep 17 00:00:00 2001 From: cylammarco Date: Thu, 12 Jan 2023 02:06:09 +0200 Subject: [PATCH 6/6] ready for v0.3.9 --- CHANGELOG.rst | 12 +++++++++++- README.md | 11 ++++++----- setup.cfg | 3 +-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 225ec2c..bd5c7a5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,13 @@ +Version 0.3.9 +------------- + +:Date: 12 Jan 2023 + +* `@cylammarco `__: + + * Fixed atlas overwriting when provided sequentially + * Capping the numpy version to 1.23.X + Version 0.3.8 ------------- @@ -5,7 +15,7 @@ Version 0.3.8 * `@cylammarco `__: - * Fix wrong MANIFEST path + * Fixed wrong MANIFEST path Version 0.3.7 ------------- diff --git a/README.md b/README.md index b3d636f..289185b 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,12 @@ More background information can be referred to this [arXiv article](https://ui.a ## Dependencies -* python >= 3.6 -* numpy -* scipy -* pynverse -* matplotlib +* python >= 3.7 +* numpy>=1.16,<1.24 +* scipy>=1.3.3 +* pynverse>=0.1.4 +* matplotlib>=3.0.3 +* tqdm>=4.48.0 ## Optional Dependencies * [plotly](https://github.com/plotly/plotly.py) >= 4.0 diff --git a/setup.cfg b/setup.cfg index 5406e0d..4faa060 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = rascal -version = 0.3.8.1 +version = 0.3.9 license = BSD-3-Clause license_files = LICENSE description = The Pyhton Automated Wavelenmgth Calibrator. @@ -16,7 +16,6 @@ download_url = https://github.com/jveitchmichaelis/rascal classifiers = License :: OSI Approved :: BSD License Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9