lime-stable 2.0.dev2__tar.gz → 2.0.dev3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {lime_stable-2.0.dev2/src/lime_stable.egg-info → lime_stable-2.0.dev3}/PKG-INFO +2 -2
  2. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/pyproject.toml +2 -2
  3. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/archives/read_fits.py +2 -1
  4. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/lime.toml +1 -1
  5. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/plotting/plots.py +1 -1
  6. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/plotting/plots_interactive.py +22 -31
  7. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3/src/lime_stable.egg-info}/PKG-INFO +2 -2
  8. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime_stable.egg-info/requires.txt +1 -1
  9. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/LICENSE.rst +0 -0
  10. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/MANIFEST.in +0 -0
  11. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/README.rst +0 -0
  12. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/setup.cfg +0 -0
  13. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/__init__.py +0 -0
  14. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/archives/__init__.py +0 -0
  15. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/archives/tables.py +0 -0
  16. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/changelog.txt +0 -0
  17. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/fitting/__init__.py +0 -0
  18. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/fitting/lines.py +0 -0
  19. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/fitting/redshift.py +0 -0
  20. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/inference/detection.py +0 -0
  21. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/inference/intensity_threshold.py +0 -0
  22. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/io.py +0 -0
  23. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/observations.py +0 -0
  24. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/plotting/__init__.py +0 -0
  25. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/plotting/bokeh_plots.py +0 -0
  26. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/plotting/format.py +0 -0
  27. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/plotting/theme_lime.toml +0 -0
  28. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/plotting/utils.py +0 -0
  29. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/resources/__init__.py +0 -0
  30. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/resources/lines_database_formatting.py +0 -0
  31. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/resources/lines_database_v2.0.0.txt +0 -0
  32. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/resources/logo.py +0 -0
  33. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/resources/types_params.txt +0 -0
  34. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/retrieve/__init__.py +0 -0
  35. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/retrieve/peaks.py +0 -0
  36. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/tools.py +0 -0
  37. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/transitions.py +0 -0
  38. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime/workflow.py +0 -0
  39. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime_stable.egg-info/SOURCES.txt +0 -0
  40. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime_stable.egg-info/dependency_links.txt +0 -0
  41. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/src/lime_stable.egg-info/top_level.txt +0 -0
  42. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_astro.py +0 -0
  43. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_cube.py +0 -0
  44. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_io.py +0 -0
  45. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_line.py +0 -0
  46. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_model.py +0 -0
  47. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_read_fits.py +0 -0
  48. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_sample.py +0 -0
  49. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_spectrum.py +0 -0
  50. {lime_stable-2.0.dev2 → lime_stable-2.0.dev3}/tests/test_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lime-stable
3
- Version: 2.0.dev2
3
+ Version: 2.0.dev3
4
4
  Summary: Line measuring algorithm for astronomical spectra
5
5
  Author-email: Vital Fernández <vgf@umich.edu>
6
6
  License-Expression: GPL-3.0-or-later
@@ -15,10 +15,10 @@ Requires-Dist: matplotlib~=3.10
15
15
  Requires-Dist: numpy~=2.2
16
16
  Requires-Dist: pandas~=2.2
17
17
  Requires-Dist: scipy~=1.15
18
+ Requires-Dist: aspect-stable~=0.3.1
18
19
  Requires-Dist: tomli>=2.0.0; python_version < "3.11"
19
20
  Provides-Extra: full
20
21
  Requires-Dist: asdf~=4.1; extra == "full"
21
- Requires-Dist: aspect-stable~=0.3.0; extra == "full"
22
22
  Requires-Dist: bokeh~=3.6; extra == "full"
23
23
  Requires-Dist: mplcursors~=0.6; extra == "full"
24
24
  Requires-Dist: openpyxl~=3.1; extra == "full"
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lime-stable"
7
- version = "2.0.dev2"
7
+ version = "2.0.dev3"
8
8
  readme = "README.rst"
9
9
  requires-python = ">=3.11"
10
10
  license = "GPL-3.0-or-later"
@@ -17,6 +17,7 @@ dependencies = ["astropy~=7.0",
17
17
  "numpy~=2.2",
18
18
  "pandas~=2.2",
19
19
  "scipy~=1.15",
20
+ "aspect-stable~=0.3.1",
20
21
  "tomli >= 2.0.0 ; python_version < '3.11'"]
21
22
 
22
23
  classifiers = ["Programming Language :: Python :: 3",
@@ -24,7 +25,6 @@ classifiers = ["Programming Language :: Python :: 3",
24
25
 
25
26
  [project.optional-dependencies]
26
27
  full = ["asdf~=4.1",
27
- "aspect-stable~=0.3.0",
28
28
  "bokeh~=3.6",
29
29
  "mplcursors~=0.6",
30
30
  "openpyxl~=3.1",
@@ -4,6 +4,7 @@ import numpy as np
4
4
  from astropy.io import fits
5
5
  from astropy.wcs import WCS
6
6
  import logging
7
+ from io import IOBase
7
8
 
8
9
  from lime.io import LiMe_Error
9
10
  from urllib.parse import urlparse
@@ -180,7 +181,7 @@ def check_fits_location(fits_address, lime_object=None, source=None):
180
181
  output = None, False
181
182
 
182
183
  # Streamlit BytesIO input
183
- elif type(fits_address).__name__ == 'UploadedFile':
184
+ elif (type(fits_address).__name__ == 'UploadedFile') or isinstance(fits_address, IOBase):
184
185
  output = fits_address, False
185
186
 
186
187
  # File address or url
@@ -1,3 +1,3 @@
1
1
  [metadata]
2
2
  name = 'lime-stable'
3
- version = "2.0.dev2"
3
+ version = "2.0.dev3"
@@ -881,7 +881,7 @@ class SpectrumFigures(Plotter):
881
881
 
882
882
  """
883
883
 
884
- This function plots the spectrum flux versus wavelength.
884
+ This function plots the spectrum flux versus wavelength.z
885
885
 
886
886
  The user can include the line bands on the plot if added via the ``line_bands`` attribute.
887
887
 
@@ -549,7 +549,7 @@ class RedshiftInspectionSingle:
549
549
 
550
550
  def redshift(self, reference_lines, output_file_log=None, output_idcs=None, redshift_column='redshift',
551
551
  none_value=np.nan, unknown_value=0.0, legend_handle='levels', maximize=False, title_label=None,
552
- output_address=None, plt_cfg={}, ax_cfg={}, in_fig=None):
552
+ output_address=None, fig_cfg={}, ax_cfg={}, in_fig=None):
553
553
 
554
554
  # Assign the attributes
555
555
  self._obj_idcs = None
@@ -581,16 +581,12 @@ class RedshiftInspectionSingle:
581
581
  idcs_sorted = np.argsort(_waves_array)
582
582
  self._waves_array, self._latex_array = _waves_array[idcs_sorted], _latex_array[idcs_sorted]
583
583
 
584
- # Set figure format with the user inputs overwriting the default conf
585
- plt_cfg.setdefault('figure.figsize', (10, 6))
586
- plt_cfg.setdefault('axes.labelsize', 12)
587
- plt_cfg.setdefault('xtick.labelsize', 10)
588
- plt_cfg.setdefault('ytick.labelsize', 10)
584
+ # Set the plot format where the user's overwrites the default
585
+ size_conf = {'figure.figsize': (10, 6), 'axes.labelsize': 12, 'xtick.labelsize': 10, 'ytick.labelsize': 10}
586
+ size_conf = size_conf if fig_cfg is None else {**size_conf, **fig_cfg}
589
587
 
590
- norm_flux = self._sample.load_params.get('norm_flux')
591
- units_wave, units_flux = self._sample.load_params.get('units_wave'), self._sample.load_params.get('units_flux')
592
- PLT_CONF, self._AXES_CONF = self._figure_format(plt_cfg, ax_cfg, norm_flux=norm_flux, units_wave=units_wave,
593
- units_flux=units_flux)
588
+ PLT_CONF = theme.fig_defaults(size_conf)
589
+ self._AXES_CONF = theme.ax_defaults(ax_cfg, self._spec.units_wave, self._spec.units_flux, self._spec.norm_flux, fig_type=None)
594
590
 
595
591
  # Create and fill the figure
596
592
  with rc_context(PLT_CONF):
@@ -601,15 +597,12 @@ class RedshiftInspectionSingle:
601
597
  self._ax = self._fig.add_subplot(gs[0])
602
598
  self._ax.set(**self._AXES_CONF)
603
599
 
604
- # Line Selection axis
600
+ # Create the RadioButtons widget for the lines
605
601
  buttoms_ax = self._fig.add_subplot(gs[1])
606
- buttons_list = [r'$None$'] + list(self._latex_array) + [r'$Unknown$']
607
- radio = RadioButtons(buttoms_ax, buttons_list)
608
- for circle in radio.circles: # Make the buttons a bit rounder
609
- circle.set_height(0.025)
610
- circle.set_width(0.075)
611
- for r in radio.labels:
612
- r.set_fontsize(6)
602
+ labels_buttons = [r'$None$'] + list(self._latex_array) + [r'$Unknown$']
603
+ radio_props = {'s': [10] * len(labels_buttons)}
604
+ label_props = {'fontsize': [6] * len(labels_buttons)}
605
+ radio = RadioButtons(buttoms_ax, labels_buttons, radio_props=radio_props, label_props=label_props)
613
606
 
614
607
  # Plot the spectrum
615
608
  self._launch_plots_ZI()
@@ -894,16 +887,12 @@ class RedshiftInspection:
894
887
  self._ax = self._fig.add_subplot(gs[0])
895
888
  self._ax.set(**self._AXES_CONF)
896
889
 
897
- # Line Selection axis
890
+ # Create the RadioButtons widget for the lines
898
891
  buttoms_ax = self._fig.add_subplot(gs[1])
899
- buttons_list = [r'$None$'] + list(self._latex_array) + [r'$Unknown$']
900
- radio = RadioButtons(buttoms_ax, buttons_list)
901
- for circle in radio.circles: # Make the buttons a bit rounder
902
- circle.set_height(0.025)
903
- circle.set_width(0.075)
904
- circle.set_edgecolor(theme.colors['fg']) # or any color like 'black', '#333333', etc.
905
- for r in radio.labels:
906
- r.set_fontsize(6)
892
+ labels_buttons = [r'$None$'] + list(self._latex_array) + [r'$Unknown$']
893
+ radio_props = {'s': [10] * len(labels_buttons)}
894
+ label_props = {'fontsize': [6] * len(labels_buttons)}
895
+ radio = RadioButtons(buttoms_ax, labels_buttons, radio_props=radio_props, label_props=label_props)
907
896
 
908
897
  # Plot the spectrum
909
898
  self._launch_plots_ZI()
@@ -1349,10 +1338,12 @@ class CubeInspection:
1349
1338
  # Buttons axis if provided
1350
1339
  if len(self.masks_dict) > 0:
1351
1340
  self._ax2 = self._fig.add_subplot(gs_image[1])
1352
- radio = RadioButtons(self._ax2, list(self.masks_dict.keys()))
1353
1341
 
1354
- for r in radio.labels:
1355
- r.set_fontsize(5)
1342
+ # Create the RadioButtons widget with the specified properties
1343
+ labels_buttons = list(self.masks_dict.keys())
1344
+ radio_props = {'s': [10] * len(labels_buttons)}
1345
+ label_props = {'fontsize': [5] * len(labels_buttons)}
1346
+ radio = RadioButtons(self._ax2, labels_buttons, radio_props=radio_props, label_props=label_props)
1356
1347
 
1357
1348
  # Plot the data
1358
1349
  self.data_plots()
@@ -1733,7 +1724,7 @@ class MaskInspection:
1733
1724
  return
1734
1725
 
1735
1726
 
1736
- class SpectrumCheck(Plotter, RedshiftInspection, BandsInspection):
1727
+ class SpectrumCheck(Plotter, RedshiftInspectionSingle, BandsInspection):
1737
1728
 
1738
1729
  def __init__(self, spectrum):
1739
1730
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lime-stable
3
- Version: 2.0.dev2
3
+ Version: 2.0.dev3
4
4
  Summary: Line measuring algorithm for astronomical spectra
5
5
  Author-email: Vital Fernández <vgf@umich.edu>
6
6
  License-Expression: GPL-3.0-or-later
@@ -15,10 +15,10 @@ Requires-Dist: matplotlib~=3.10
15
15
  Requires-Dist: numpy~=2.2
16
16
  Requires-Dist: pandas~=2.2
17
17
  Requires-Dist: scipy~=1.15
18
+ Requires-Dist: aspect-stable~=0.3.1
18
19
  Requires-Dist: tomli>=2.0.0; python_version < "3.11"
19
20
  Provides-Extra: full
20
21
  Requires-Dist: asdf~=4.1; extra == "full"
21
- Requires-Dist: aspect-stable~=0.3.0; extra == "full"
22
22
  Requires-Dist: bokeh~=3.6; extra == "full"
23
23
  Requires-Dist: mplcursors~=0.6; extra == "full"
24
24
  Requires-Dist: openpyxl~=3.1; extra == "full"
@@ -4,6 +4,7 @@ matplotlib~=3.10
4
4
  numpy~=2.2
5
5
  pandas~=2.2
6
6
  scipy~=1.15
7
+ aspect-stable~=0.3.1
7
8
 
8
9
  [:python_version < "3.11"]
9
10
  tomli>=2.0.0
@@ -15,7 +16,6 @@ sphinx-rtd-theme~=3.0
15
16
 
16
17
  [full]
17
18
  asdf~=4.1
18
- aspect-stable~=0.3.0
19
19
  bokeh~=3.6
20
20
  mplcursors~=0.6
21
21
  openpyxl~=3.1
File without changes