starplot 0.11.2__tar.gz → 0.11.4__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 (191) hide show
  1. {starplot-0.11.2 → starplot-0.11.4}/PKG-INFO +1 -1
  2. {starplot-0.11.2 → starplot-0.11.4}/docs/changelog.md +4 -0
  3. {starplot-0.11.2 → starplot-0.11.4}/hash_checks/hashio.py +19 -14
  4. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/__init__.py +1 -1
  5. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/base.py +2 -5
  6. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/dso.py +21 -17
  7. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/plotters/dsos.py +2 -18
  8. {starplot-0.11.2 → starplot-0.11.4}/.dockerignore +0 -0
  9. {starplot-0.11.2 → starplot-0.11.4}/.github/FUNDING.yml +0 -0
  10. {starplot-0.11.2 → starplot-0.11.4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  11. {starplot-0.11.2 → starplot-0.11.4}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  12. {starplot-0.11.2 → starplot-0.11.4}/.github/workflows/docs.yml +0 -0
  13. {starplot-0.11.2 → starplot-0.11.4}/.github/workflows/release.yml +0 -0
  14. {starplot-0.11.2 → starplot-0.11.4}/.github/workflows/test.yml +0 -0
  15. {starplot-0.11.2 → starplot-0.11.4}/.gitignore +0 -0
  16. {starplot-0.11.2 → starplot-0.11.4}/CODE_OF_CONDUCT.md +0 -0
  17. {starplot-0.11.2 → starplot-0.11.4}/CONTRIBUTING.md +0 -0
  18. {starplot-0.11.2 → starplot-0.11.4}/Dockerfile +0 -0
  19. {starplot-0.11.2 → starplot-0.11.4}/LICENSE +0 -0
  20. {starplot-0.11.2 → starplot-0.11.4}/Makefile +0 -0
  21. {starplot-0.11.2 → starplot-0.11.4}/README.md +0 -0
  22. {starplot-0.11.2 → starplot-0.11.4}/docs/about.md +0 -0
  23. {starplot-0.11.2 → starplot-0.11.4}/docs/coming-soon.md +0 -0
  24. {starplot-0.11.2 → starplot-0.11.4}/docs/css/extra.css +0 -0
  25. {starplot-0.11.2 → starplot-0.11.4}/docs/custom/main.html +0 -0
  26. {starplot-0.11.2 → starplot-0.11.4}/docs/data/.keep +0 -0
  27. {starplot-0.11.2 → starplot-0.11.4}/docs/data-sources.md +0 -0
  28. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/map-big-dipper.md +0 -0
  29. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/map-big.md +0 -0
  30. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/map-comet-neowise.md +0 -0
  31. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/map-milky-way-stars.md +0 -0
  32. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/map-orion.md +0 -0
  33. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/map-orthographic.md +0 -0
  34. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/map-sagittarius.md +0 -0
  35. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/optic-m45.md +0 -0
  36. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/optic-moon-saturn.md +0 -0
  37. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/optic-orion.md +0 -0
  38. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/optic-solar-eclipse.md +0 -0
  39. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/star-chart-basic.md +0 -0
  40. {starplot-0.11.2 → starplot-0.11.4}/docs/examples/star-chart-detail.md +0 -0
  41. {starplot-0.11.2 → starplot-0.11.4}/docs/examples.md +0 -0
  42. {starplot-0.11.2 → starplot-0.11.4}/docs/gallery.md +0 -0
  43. {starplot-0.11.2 → starplot-0.11.4}/docs/images/banner.png +0 -0
  44. {starplot-0.11.2 → starplot-0.11.4}/docs/images/banner.svg +0 -0
  45. {starplot-0.11.2 → starplot-0.11.4}/docs/images/banner.vectornator +0 -0
  46. {starplot-0.11.2 → starplot-0.11.4}/docs/images/celestial-globe.svg +0 -0
  47. {starplot-0.11.2 → starplot-0.11.4}/docs/images/examples/.keep +0 -0
  48. {starplot-0.11.2 → starplot-0.11.4}/docs/images/favicon.png +0 -0
  49. {starplot-0.11.2 → starplot-0.11.4}/docs/images/favicon.svg +0 -0
  50. {starplot-0.11.2 → starplot-0.11.4}/docs/images/logo.png +0 -0
  51. {starplot-0.11.2 → starplot-0.11.4}/docs/images/logo.svg +0 -0
  52. {starplot-0.11.2 → starplot-0.11.4}/docs/images/logo.vectornator +0 -0
  53. {starplot-0.11.2 → starplot-0.11.4}/docs/images/logo2.png +0 -0
  54. {starplot-0.11.2 → starplot-0.11.4}/docs/images/logo2.vectornator +0 -0
  55. {starplot-0.11.2 → starplot-0.11.4}/docs/images/logo500.png +0 -0
  56. {starplot-0.11.2 → starplot-0.11.4}/docs/images/mono.png +0 -0
  57. {starplot-0.11.2 → starplot-0.11.4}/docs/images/mono.svg +0 -0
  58. {starplot-0.11.2 → starplot-0.11.4}/docs/images/star.svg +0 -0
  59. {starplot-0.11.2 → starplot-0.11.4}/docs/images/tutorial/.keep +0 -0
  60. {starplot-0.11.2 → starplot-0.11.4}/docs/index.md +0 -0
  61. {starplot-0.11.2 → starplot-0.11.4}/docs/installation.md +0 -0
  62. {starplot-0.11.2 → starplot-0.11.4}/docs/license.md +0 -0
  63. {starplot-0.11.2 → starplot-0.11.4}/docs/reference-callables.md +0 -0
  64. {starplot-0.11.2 → starplot-0.11.4}/docs/reference-data.md +0 -0
  65. {starplot-0.11.2 → starplot-0.11.4}/docs/reference-mapplot.md +0 -0
  66. {starplot-0.11.2 → starplot-0.11.4}/docs/reference-models.md +0 -0
  67. {starplot-0.11.2 → starplot-0.11.4}/docs/reference-ongc.md +0 -0
  68. {starplot-0.11.2 → starplot-0.11.4}/docs/reference-opticplot.md +0 -0
  69. {starplot-0.11.2 → starplot-0.11.4}/docs/reference-selecting-objects.md +0 -0
  70. {starplot-0.11.2 → starplot-0.11.4}/docs/reference-styling.md +0 -0
  71. {starplot-0.11.2 → starplot-0.11.4}/docs/robots.txt +0 -0
  72. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/01.md +0 -0
  73. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/02.md +0 -0
  74. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/03.md +0 -0
  75. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/04.md +0 -0
  76. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/05.md +0 -0
  77. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/06.md +0 -0
  78. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/07.md +0 -0
  79. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/08.md +0 -0
  80. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial/09.md +0 -0
  81. {starplot-0.11.2 → starplot-0.11.4}/docs/tutorial.md +0 -0
  82. {starplot-0.11.2 → starplot-0.11.4}/examples/examples.py +0 -0
  83. {starplot-0.11.2 → starplot-0.11.4}/examples/map_big.py +0 -0
  84. {starplot-0.11.2 → starplot-0.11.4}/examples/map_big_dipper.py +0 -0
  85. {starplot-0.11.2 → starplot-0.11.4}/examples/map_comet_neowise.py +0 -0
  86. {starplot-0.11.2 → starplot-0.11.4}/examples/map_milky_way_stars.py +0 -0
  87. {starplot-0.11.2 → starplot-0.11.4}/examples/map_orion.py +0 -0
  88. {starplot-0.11.2 → starplot-0.11.4}/examples/map_orthographic.py +0 -0
  89. {starplot-0.11.2 → starplot-0.11.4}/examples/map_sagittarius.py +0 -0
  90. {starplot-0.11.2 → starplot-0.11.4}/examples/optic_m45.py +0 -0
  91. {starplot-0.11.2 → starplot-0.11.4}/examples/optic_moon_saturn.py +0 -0
  92. {starplot-0.11.2 → starplot-0.11.4}/examples/optic_orion_nebula.py +0 -0
  93. {starplot-0.11.2 → starplot-0.11.4}/examples/optic_solar_eclipse.py +0 -0
  94. {starplot-0.11.2 → starplot-0.11.4}/examples/star_chart_basic.py +0 -0
  95. {starplot-0.11.2 → starplot-0.11.4}/examples/star_chart_detail.py +0 -0
  96. {starplot-0.11.2 → starplot-0.11.4}/hash_checks/__init__.py +0 -0
  97. {starplot-0.11.2 → starplot-0.11.4}/hash_checks/data/.keep +0 -0
  98. {starplot-0.11.2 → starplot-0.11.4}/hash_checks/hashlock.yml +0 -0
  99. {starplot-0.11.2 → starplot-0.11.4}/hash_checks/map_checks.py +0 -0
  100. {starplot-0.11.2 → starplot-0.11.4}/hash_checks/optic_checks.py +0 -0
  101. {starplot-0.11.2 → starplot-0.11.4}/hash_checks/template.html +0 -0
  102. {starplot-0.11.2 → starplot-0.11.4}/hash_checks/zenith_checks.py +0 -0
  103. {starplot-0.11.2 → starplot-0.11.4}/mkdocs.yml +0 -0
  104. {starplot-0.11.2 → starplot-0.11.4}/pyproject.toml +0 -0
  105. {starplot-0.11.2 → starplot-0.11.4}/requirements-dev.txt +0 -0
  106. {starplot-0.11.2 → starplot-0.11.4}/requirements.txt +0 -0
  107. {starplot-0.11.2 → starplot-0.11.4}/scripts/constellation_hips.py +0 -0
  108. {starplot-0.11.2 → starplot-0.11.4}/scripts/download_cons.py +0 -0
  109. {starplot-0.11.2 → starplot-0.11.4}/scripts/ecliptic.py +0 -0
  110. {starplot-0.11.2 → starplot-0.11.4}/scripts/gallery.py +0 -0
  111. {starplot-0.11.2 → starplot-0.11.4}/scripts/geopack.py +0 -0
  112. {starplot-0.11.2 → starplot-0.11.4}/scripts/gpack_constellations.py +0 -0
  113. {starplot-0.11.2 → starplot-0.11.4}/scripts/hip.py +0 -0
  114. {starplot-0.11.2 → starplot-0.11.4}/scripts/hip_parquet.py +0 -0
  115. {starplot-0.11.2 → starplot-0.11.4}/scripts/ipy.py +0 -0
  116. {starplot-0.11.2 → starplot-0.11.4}/scripts/moonphases.py +0 -0
  117. {starplot-0.11.2 → starplot-0.11.4}/scripts/ongc_docdata.py +0 -0
  118. {starplot-0.11.2 → starplot-0.11.4}/scripts/ongc_geopack.py +0 -0
  119. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/callables.py +0 -0
  120. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/__init__.py +0 -0
  121. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/bayer.py +0 -0
  122. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/bigsky.py +0 -0
  123. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/constellations.py +0 -0
  124. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/dsos.py +0 -0
  125. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/ecliptic.py +0 -0
  126. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/constellation_borders_inv.gpkg +0 -0
  127. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/constellation_lines_hips.json +0 -0
  128. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/constellation_lines_inv.gpkg +0 -0
  129. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/constellations.gpkg +0 -0
  130. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/constellations_hip.fab +0 -0
  131. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/de421_2001.bsp +0 -0
  132. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/de440s.bsp +0 -0
  133. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/milkyway.gpkg +0 -0
  134. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/milkyway_inv.gpkg +0 -0
  135. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/ongc.gpkg.zip +0 -0
  136. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/stars.bigsky.mag11.parquet +0 -0
  137. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/library/stars.hipparcos.parquet +0 -0
  138. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/messier.py +0 -0
  139. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/stars.py +0 -0
  140. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/data/utils.py +0 -0
  141. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/geod.py +0 -0
  142. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/map.py +0 -0
  143. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/mixins.py +0 -0
  144. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/__init__.py +0 -0
  145. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/base.py +0 -0
  146. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/constellation.py +0 -0
  147. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/moon.py +0 -0
  148. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/objects.py +0 -0
  149. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/planet.py +0 -0
  150. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/star.py +0 -0
  151. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/models/sun.py +0 -0
  152. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/optic.py +0 -0
  153. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/optics.py +0 -0
  154. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/plotters/__init__.py +0 -0
  155. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/plotters/stars.py +0 -0
  156. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/projections.py +0 -0
  157. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/__init__.py +0 -0
  158. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/base.py +0 -0
  159. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/antique.yml +0 -0
  160. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/blue_dark.yml +0 -0
  161. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/blue_light.yml +0 -0
  162. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/blue_medium.yml +0 -0
  163. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/cb_wong.yml +0 -0
  164. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/color_print.yml +0 -0
  165. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/grayscale.yml +0 -0
  166. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/grayscale_dark.yml +0 -0
  167. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/map.yml +0 -0
  168. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/nord.yml +0 -0
  169. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/ext/optic.yml +0 -0
  170. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/extensions.py +0 -0
  171. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/styles/helpers.py +0 -0
  172. {starplot-0.11.2 → starplot-0.11.4}/src/starplot/utils.py +0 -0
  173. {starplot-0.11.2 → starplot-0.11.4}/tests/__init__.py +0 -0
  174. {starplot-0.11.2 → starplot-0.11.4}/tests/data/.keep +0 -0
  175. {starplot-0.11.2 → starplot-0.11.4}/tests/test_constellations.py +0 -0
  176. {starplot-0.11.2 → starplot-0.11.4}/tests/test_data.py +0 -0
  177. {starplot-0.11.2 → starplot-0.11.4}/tests/test_map.py +0 -0
  178. {starplot-0.11.2 → starplot-0.11.4}/tests/test_models.py +0 -0
  179. {starplot-0.11.2 → starplot-0.11.4}/tests/test_optic.py +0 -0
  180. {starplot-0.11.2 → starplot-0.11.4}/tests/test_stars.py +0 -0
  181. {starplot-0.11.2 → starplot-0.11.4}/tests/test_styles.py +0 -0
  182. {starplot-0.11.2 → starplot-0.11.4}/tests/test_utils.py +0 -0
  183. {starplot-0.11.2 → starplot-0.11.4}/tests/utils.py +0 -0
  184. {starplot-0.11.2 → starplot-0.11.4}/tutorial/build.py +0 -0
  185. {starplot-0.11.2 → starplot-0.11.4}/tutorial/tutorial_02.py +0 -0
  186. {starplot-0.11.2 → starplot-0.11.4}/tutorial/tutorial_03.py +0 -0
  187. {starplot-0.11.2 → starplot-0.11.4}/tutorial/tutorial_04.py +0 -0
  188. {starplot-0.11.2 → starplot-0.11.4}/tutorial/tutorial_05.py +0 -0
  189. {starplot-0.11.2 → starplot-0.11.4}/tutorial/tutorial_06.py +0 -0
  190. {starplot-0.11.2 → starplot-0.11.4}/tutorial/tutorial_07.py +0 -0
  191. {starplot-0.11.2 → starplot-0.11.4}/tutorial/tutorial_08.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: starplot
3
- Version: 0.11.2
3
+ Version: 0.11.4
4
4
  Summary: Star charts and maps
5
5
  Keywords: astronomy,stars,charts,maps,constellations
6
6
  Author-email: Steve Berardi <hello@steveberardi.com>
@@ -16,6 +16,10 @@
16
16
  - Fixes default horizon style to be consistent with grayscale extension
17
17
  - [**v0.11.2**]
18
18
  - Adds `requests` as a required dependency
19
+ - [**v0.11.3**]
20
+ - Fixes bug with plotting the celestial equator
21
+ - [**v0.11.4**]
22
+ - Fixes bug with filtering DSOs by NGC/IC identifier
19
23
 
20
24
  ## v0.10.x
21
25
  [Documentation](https://archives.starplot.dev/0.10.2/)
@@ -1,6 +1,7 @@
1
1
  import sys
2
2
  import inspect
3
3
  import time
4
+ import multiprocessing as mp
4
5
 
5
6
  from pathlib import Path
6
7
 
@@ -73,22 +74,26 @@ class Hashio:
73
74
  def _phash(self, img) -> str:
74
75
  return str(imagehash.phash(img))
75
76
 
77
+ def _call_wrapper(self, c):
78
+ func_name = c.__name__[6:]
79
+ console.print(f"{func_name}...")
80
+ filename = c()
81
+ img = Image.open(filename)
82
+ return func_name, {
83
+ "filename": str(filename),
84
+ "dhash": self._dhash(img),
85
+ "phash": self._phash(img),
86
+ }
87
+
76
88
  def _get_hashes(self) -> dict:
77
89
  """Gets hashes for all callables"""
78
- hashes = {}
79
- with console.status("Getting hashes...", spinner="aesthetic"):
80
- for c in self.callables:
81
- func_name = c.__name__[6:]
82
- console.print(f"{func_name}...")
83
- filename = c()
84
- img = Image.open(filename)
85
- hashes[func_name] = {
86
- "filename": str(filename),
87
- "dhash": self._dhash(img),
88
- "phash": self._phash(img),
89
- }
90
-
91
- return hashes
90
+ mp.set_start_method("spawn") # required for M1 macs? or macOS issue?
91
+
92
+ console.print("Getting hashes...", style="bold")
93
+ with mp.Pool(5) as p:
94
+ results = p.map(self._call_wrapper, self.callables)
95
+
96
+ return {func_name: hashes for func_name, hashes in results}
92
97
 
93
98
  def _check(self):
94
99
  passed = {}
@@ -1,6 +1,6 @@
1
1
  """Star charts and maps"""
2
2
 
3
- __version__ = "0.11.2"
3
+ __version__ = "0.11.4"
4
4
 
5
5
  from .base import BasePlot # noqa: F401
6
6
  from .map import MapPlot, Projection # noqa: F401
@@ -852,11 +852,8 @@ class BasePlot(ABC):
852
852
 
853
853
  # TODO : handle wrapping
854
854
 
855
- ra_start = max(0, int(self.ra_min) - 2) * 100
856
- ra_end = min(24, int(self.ra_max) + 2) * 100
857
-
858
- for ra in range(ra_start, ra_end, 2):
859
- x0, y0 = self._prepare_coords(ra / 100, 0)
855
+ for ra in range(25):
856
+ x0, y0 = self._prepare_coords(ra, 0)
860
857
  x.append(x0)
861
858
  y.append(y0)
862
859
 
@@ -1,6 +1,6 @@
1
1
  from typing import Optional
2
2
 
3
- from starplot.data.dsos import DsoType
3
+ from starplot.data.dsos import DsoType, load_ongc, ONGC_TYPE_MAP
4
4
  from starplot.mixins import CreateMapMixin, CreateOpticMixin
5
5
  from starplot.models.base import SkyObject, SkyObjectManager
6
6
 
@@ -8,27 +8,12 @@ from starplot.models.base import SkyObject, SkyObjectManager
8
8
  class DsoManager(SkyObjectManager):
9
9
  @classmethod
10
10
  def all(cls):
11
- from starplot.data.dsos import load_ongc, ONGC_TYPE_MAP
12
-
13
11
  all_dsos = load_ongc()
14
12
 
15
13
  for d in all_dsos.itertuples():
16
14
  magnitude = d.mag_v or d.mag_b or None
17
15
  magnitude = float(magnitude) if magnitude else None
18
- yield DSO(
19
- name=d.name,
20
- ra=d.ra_degrees / 15,
21
- dec=d.dec_degrees,
22
- type=ONGC_TYPE_MAP[d.type],
23
- maj_ax=d.maj_ax,
24
- min_ax=d.min_ax,
25
- angle=d.angle,
26
- magnitude=magnitude,
27
- size=d.size_deg2,
28
- m=d.m,
29
- ngc=d.ngc,
30
- ic=d.ic,
31
- )
16
+ yield from_tuple(d)
32
17
 
33
18
 
34
19
  class DSO(SkyObject, CreateMapMixin, CreateOpticMixin):
@@ -131,3 +116,22 @@ class DSO(SkyObject, CreateMapMixin, CreateOpticMixin):
131
116
 
132
117
  """
133
118
  pass
119
+
120
+
121
+ def from_tuple(d: tuple) -> DSO:
122
+ magnitude = d.mag_v or d.mag_b or None
123
+ magnitude = float(magnitude) if magnitude else None
124
+ return DSO(
125
+ name=d.name,
126
+ ra=d.ra_degrees / 15,
127
+ dec=d.dec_degrees,
128
+ type=ONGC_TYPE_MAP[d.type],
129
+ maj_ax=d.maj_ax,
130
+ min_ax=d.min_ax,
131
+ angle=d.angle,
132
+ magnitude=magnitude,
133
+ size=d.size_deg2,
134
+ m=d.m,
135
+ ngc=d.ngc,
136
+ ic=d.ic,
137
+ )
@@ -10,7 +10,7 @@ from starplot.data.dsos import (
10
10
  DsoLabelMaker,
11
11
  load_ongc,
12
12
  )
13
- from starplot.models import DSO
13
+ from starplot.models.dso import DSO, from_tuple
14
14
  from starplot.styles import MarkerSymbolEnum
15
15
 
16
16
 
@@ -22,22 +22,6 @@ class DsoPlotterMixin:
22
22
  coords.append(coords[0])
23
23
  self._polygon(coords, style.marker.to_polygon_style(), closed=False)
24
24
 
25
- def _dso_from_df_tuple(self, d):
26
- magnitude = d.mag_v or d.mag_b or None
27
- magnitude = float(magnitude) if magnitude else None
28
- return DSO(
29
- name=d.name,
30
- ra=d.ra_degrees / 15,
31
- dec=d.dec_degrees,
32
- type=ONGC_TYPE_MAP[d.type],
33
- maj_ax=d.maj_ax,
34
- min_ax=d.min_ax,
35
- angle=d.angle,
36
- magnitude=magnitude,
37
- size=d.size_deg2,
38
- m=d.m,
39
- )
40
-
41
25
  def open_clusters(self, *args, **kwargs):
42
26
  """
43
27
  Plots open clusters
@@ -155,7 +139,7 @@ class DsoPlotterMixin:
155
139
  legend_label = legend_labels.get(dso_type)
156
140
  magnitude = d.mag_v or d.mag_b or None
157
141
  magnitude = float(magnitude) if magnitude else None
158
- _dso = self._dso_from_df_tuple(d)
142
+ _dso = from_tuple(d)
159
143
 
160
144
  if any(
161
145
  [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes