space-classy 0.7__tar.gz → 0.8__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 (200) hide show
  1. {space_classy-0.7 → space_classy-0.8}/PKG-INFO +8 -15
  2. {space_classy-0.7 → space_classy-0.8}/README.md +2 -0
  3. {space_classy-0.7 → space_classy-0.8}/classy/__init__.py +4 -4
  4. space_classy-0.8/classy/cli.py +287 -0
  5. space_classy-0.8/classy/config.py +21 -0
  6. space_classy-0.8/classy/core.py +621 -0
  7. space_classy-0.8/classy/features/__init__.py +267 -0
  8. space_classy-0.8/classy/features/__pycache__/__init__.cpython-39.pyc +0 -0
  9. space_classy-0.8/classy/features/feature.py +0 -0
  10. {space_classy-0.7/classy → space_classy-0.8/classy/features}/gui.py +29 -28
  11. space_classy-0.8/classy/index/__init__.py +288 -0
  12. space_classy-0.8/classy/index/__pycache__/__init__.cpython-39.pyc +0 -0
  13. space_classy-0.8/classy/index/__pycache__/data.cpython-39.pyc +0 -0
  14. space_classy-0.8/classy/index/__pycache__/phase.cpython-39.pyc +0 -0
  15. {space_classy-0.7/classy → space_classy-0.8/classy/index}/data.py +80 -6
  16. space_classy-0.8/classy/index/phase.py +208 -0
  17. space_classy-0.8/classy/plotting.py +791 -0
  18. {space_classy-0.7 → space_classy-0.8}/classy/preprocessing.py +33 -17
  19. {space_classy-0.7 → space_classy-0.8}/classy/sources/__init__.py +54 -10
  20. space_classy-0.8/classy/sources/__pycache__/__init__.cpython-310.pyc +0 -0
  21. space_classy-0.8/classy/sources/__pycache__/__init__.cpython-311.pyc +0 -0
  22. space_classy-0.8/classy/sources/__pycache__/__init__.cpython-39.pyc +0 -0
  23. space_classy-0.8/classy/sources/__pycache__/akari.cpython-310.pyc +0 -0
  24. space_classy-0.8/classy/sources/__pycache__/akari.cpython-311.pyc +0 -0
  25. space_classy-0.8/classy/sources/__pycache__/akari.cpython-39.pyc +0 -0
  26. space_classy-0.8/classy/sources/__pycache__/gaia.cpython-310.pyc +0 -0
  27. space_classy-0.8/classy/sources/__pycache__/gaia.cpython-311.pyc +0 -0
  28. space_classy-0.8/classy/sources/__pycache__/gaia.cpython-39.pyc +0 -0
  29. space_classy-0.8/classy/sources/__pycache__/m4ast.cpython-311.pyc +0 -0
  30. space_classy-0.8/classy/sources/__pycache__/m4ast.cpython-39.pyc +0 -0
  31. space_classy-0.8/classy/sources/__pycache__/mithneos.cpython-310.pyc +0 -0
  32. space_classy-0.8/classy/sources/__pycache__/mithneos.cpython-311.pyc +0 -0
  33. space_classy-0.8/classy/sources/__pycache__/mithneos.cpython-39.pyc +0 -0
  34. space_classy-0.8/classy/sources/__pycache__/pds.cpython-310.pyc +0 -0
  35. space_classy-0.8/classy/sources/__pycache__/private.cpython-310.pyc +0 -0
  36. space_classy-0.8/classy/sources/__pycache__/private.cpython-311.pyc +0 -0
  37. space_classy-0.8/classy/sources/__pycache__/private.cpython-39.pyc +0 -0
  38. space_classy-0.8/classy/sources/__pycache__/smass.cpython-310.pyc +0 -0
  39. space_classy-0.8/classy/sources/__pycache__/smass.cpython-311.pyc +0 -0
  40. space_classy-0.8/classy/sources/__pycache__/smass.cpython-39.pyc +0 -0
  41. {space_classy-0.7 → space_classy-0.8}/classy/sources/akari.py +10 -3
  42. space_classy-0.8/classy/sources/cds/__init__.py +54 -0
  43. space_classy-0.8/classy/sources/cds/__pycache__/J_AA_568_L7.cpython-311.pyc +0 -0
  44. space_classy-0.8/classy/sources/cds/__pycache__/__init__.cpython-311.pyc +0 -0
  45. space_classy-0.8/classy/sources/cds/__pycache__/__init__.cpython-39.pyc +0 -0
  46. space_classy-0.8/classy/sources/cds/__pycache__/j_aa_568_l7.cpython-311.pyc +0 -0
  47. space_classy-0.8/classy/sources/cds/__pycache__/j_aa_568_l7.cpython-39.pyc +0 -0
  48. space_classy-0.8/classy/sources/cds/__pycache__/j_aa_627_a124.cpython-311.pyc +0 -0
  49. space_classy-0.8/classy/sources/cds/__pycache__/j_aa_627_a124.cpython-39.pyc +0 -0
  50. {space_classy-0.7 → space_classy-0.8}/classy/sources/cds/j_aa_568_l7.py +3 -3
  51. {space_classy-0.7 → space_classy-0.8}/classy/sources/cds/j_aa_627_a124.py +3 -3
  52. {space_classy-0.7 → space_classy-0.8}/classy/sources/gaia.py +44 -35
  53. {space_classy-0.7 → space_classy-0.8}/classy/sources/m4ast.py +7 -11
  54. {space_classy-0.7 → space_classy-0.8}/classy/sources/mithneos.py +54 -103
  55. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/__init__.py +9 -4
  56. space_classy-0.8/classy/sources/pds/__pycache__/_24cas.cpython-310.pyc +0 -0
  57. space_classy-0.8/classy/sources/pds/__pycache__/__init__.cpython-310.pyc +0 -0
  58. space_classy-0.8/classy/sources/pds/__pycache__/__init__.cpython-311.pyc +0 -0
  59. space_classy-0.8/classy/sources/pds/__pycache__/__init__.cpython-39.pyc +0 -0
  60. space_classy-0.8/classy/sources/pds/__pycache__/ecas.cpython-310.pyc +0 -0
  61. space_classy-0.8/classy/sources/pds/__pycache__/ecas.cpython-311.pyc +0 -0
  62. space_classy-0.8/classy/sources/pds/__pycache__/ecas.cpython-39.pyc +0 -0
  63. space_classy-0.8/classy/sources/pds/__pycache__/fornasier_m_types.cpython-310.pyc +0 -0
  64. space_classy-0.8/classy/sources/pds/__pycache__/fornasier_m_types.cpython-311.pyc +0 -0
  65. space_classy-0.8/classy/sources/pds/__pycache__/fornasier_m_types.cpython-39.pyc +0 -0
  66. space_classy-0.8/classy/sources/pds/__pycache__/fornasier_trojans.cpython-310.pyc +0 -0
  67. space_classy-0.8/classy/sources/pds/__pycache__/fornasier_trojans.cpython-311.pyc +0 -0
  68. space_classy-0.8/classy/sources/pds/__pycache__/fornasier_trojans.cpython-39.pyc +0 -0
  69. space_classy-0.8/classy/sources/pds/__pycache__/ftcas.cpython-310.pyc +0 -0
  70. space_classy-0.8/classy/sources/pds/__pycache__/ftcas.cpython-311.pyc +0 -0
  71. space_classy-0.8/classy/sources/pds/__pycache__/ftcas.cpython-39.pyc +0 -0
  72. space_classy-0.8/classy/sources/pds/__pycache__/gartrelleetal.cpython-311.pyc +0 -0
  73. space_classy-0.8/classy/sources/pds/__pycache__/gartrelleetal.cpython-39.pyc +0 -0
  74. space_classy-0.8/classy/sources/pds/__pycache__/hardersenspec.cpython-311.pyc +0 -0
  75. space_classy-0.8/classy/sources/pds/__pycache__/hardersenspec.cpython-39.pyc +0 -0
  76. space_classy-0.8/classy/sources/pds/__pycache__/irtf.cpython-310.pyc +0 -0
  77. space_classy-0.8/classy/sources/pds/__pycache__/irtf.cpython-311.pyc +0 -0
  78. space_classy-0.8/classy/sources/pds/__pycache__/irtf.cpython-39.pyc +0 -0
  79. space_classy-0.8/classy/sources/pds/__pycache__/lebofsky_three_micron.cpython-310.pyc +0 -0
  80. space_classy-0.8/classy/sources/pds/__pycache__/moskovitz_v_types.cpython-310.pyc +0 -0
  81. space_classy-0.8/classy/sources/pds/__pycache__/moskovitz_v_types.cpython-311.pyc +0 -0
  82. space_classy-0.8/classy/sources/pds/__pycache__/moskovitz_v_types.cpython-39.pyc +0 -0
  83. space_classy-0.8/classy/sources/pds/__pycache__/primass.cpython-310.pyc +0 -0
  84. space_classy-0.8/classy/sources/pds/__pycache__/primass.cpython-311.pyc +0 -0
  85. space_classy-0.8/classy/sources/pds/__pycache__/primass.cpython-39.pyc +0 -0
  86. space_classy-0.8/classy/sources/pds/__pycache__/reddy_main_belt.cpython-310.pyc +0 -0
  87. space_classy-0.8/classy/sources/pds/__pycache__/reddy_main_belt.cpython-311.pyc +0 -0
  88. space_classy-0.8/classy/sources/pds/__pycache__/reddy_main_belt.cpython-39.pyc +0 -0
  89. space_classy-0.8/classy/sources/pds/__pycache__/reddy_nea.cpython-310.pyc +0 -0
  90. space_classy-0.8/classy/sources/pds/__pycache__/reddy_nea.cpython-311.pyc +0 -0
  91. space_classy-0.8/classy/sources/pds/__pycache__/reddy_nea.cpython-39.pyc +0 -0
  92. space_classy-0.8/classy/sources/pds/__pycache__/reddy_nea_mc.cpython-310.pyc +0 -0
  93. space_classy-0.8/classy/sources/pds/__pycache__/reddy_nea_mc.cpython-311.pyc +0 -0
  94. space_classy-0.8/classy/sources/pds/__pycache__/reddy_nea_mc.cpython-39.pyc +0 -0
  95. space_classy-0.8/classy/sources/pds/__pycache__/reddy_vesta.cpython-310.pyc +0 -0
  96. space_classy-0.8/classy/sources/pds/__pycache__/reddy_vesta.cpython-311.pyc +0 -0
  97. space_classy-0.8/classy/sources/pds/__pycache__/reddy_vesta.cpython-39.pyc +0 -0
  98. space_classy-0.8/classy/sources/pds/__pycache__/rivkin_three_micron.cpython-310.pyc +0 -0
  99. space_classy-0.8/classy/sources/pds/__pycache__/rivkin_three_micron.cpython-39.pyc +0 -0
  100. space_classy-0.8/classy/sources/pds/__pycache__/s3os2.cpython-310.pyc +0 -0
  101. space_classy-0.8/classy/sources/pds/__pycache__/s3os2.cpython-311.pyc +0 -0
  102. space_classy-0.8/classy/sources/pds/__pycache__/s3os2.cpython-39.pyc +0 -0
  103. space_classy-0.8/classy/sources/pds/__pycache__/sawyer.cpython-310.pyc +0 -0
  104. space_classy-0.8/classy/sources/pds/__pycache__/sawyer.cpython-311.pyc +0 -0
  105. space_classy-0.8/classy/sources/pds/__pycache__/sawyer.cpython-39.pyc +0 -0
  106. space_classy-0.8/classy/sources/pds/__pycache__/scas.cpython-310.pyc +0 -0
  107. space_classy-0.8/classy/sources/pds/__pycache__/scas.cpython-311.pyc +0 -0
  108. space_classy-0.8/classy/sources/pds/__pycache__/scas.cpython-39.pyc +0 -0
  109. space_classy-0.8/classy/sources/pds/__pycache__/tfcas.cpython-310.pyc +0 -0
  110. space_classy-0.8/classy/sources/pds/__pycache__/tfcas.cpython-311.pyc +0 -0
  111. space_classy-0.8/classy/sources/pds/__pycache__/tfcas.cpython-39.pyc +0 -0
  112. space_classy-0.8/classy/sources/pds/__pycache__/vilas.cpython-310.pyc +0 -0
  113. space_classy-0.8/classy/sources/pds/__pycache__/vilas.cpython-311.pyc +0 -0
  114. space_classy-0.8/classy/sources/pds/__pycache__/vilas.cpython-39.pyc +0 -0
  115. space_classy-0.8/classy/sources/pds/__pycache__/willman_iannini.cpython-310.pyc +0 -0
  116. space_classy-0.8/classy/sources/pds/__pycache__/willman_iannini.cpython-311.pyc +0 -0
  117. space_classy-0.8/classy/sources/pds/__pycache__/willman_iannini.cpython-39.pyc +0 -0
  118. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/ecas.py +3 -4
  119. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/fornasier_m_types.py +1 -1
  120. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/fornasier_trojans.py +1 -1
  121. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/ftcas.py +2 -2
  122. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/gartrelleetal.py +1 -1
  123. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/hardersenspec.py +11 -2
  124. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/irtf.py +1 -1
  125. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/lebofsky_three_micron.py +2 -2
  126. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/moskovitz_v_types.py +1 -1
  127. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/primass.py +1 -1
  128. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/reddy_main_belt.py +1 -1
  129. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/reddy_nea.py +1 -1
  130. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/reddy_nea_mc.py +2 -2
  131. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/reddy_vesta.py +1 -1
  132. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/rivkin_three_micron.py +2 -2
  133. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/s3os2.py +1 -1
  134. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/sawyer.py +1 -1
  135. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/scas.py +2 -2
  136. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/tfcas.py +2 -2
  137. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/vilas.py +1 -1
  138. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/willman_iannini.py +1 -1
  139. {space_classy-0.7 → space_classy-0.8}/classy/sources/private.py +3 -3
  140. {space_classy-0.7 → space_classy-0.8}/classy/sources/smass.py +12 -6
  141. {space_classy-0.7 → space_classy-0.8}/classy/taxonomies/__init__.py +3 -1
  142. space_classy-0.8/classy/taxonomies/__pycache__/__init__.cpython-310.pyc +0 -0
  143. space_classy-0.8/classy/taxonomies/__pycache__/__init__.cpython-311.pyc +0 -0
  144. space_classy-0.8/classy/taxonomies/__pycache__/__init__.cpython-39.pyc +0 -0
  145. space_classy-0.8/classy/taxonomies/__pycache__/bus.cpython-310.pyc +0 -0
  146. space_classy-0.8/classy/taxonomies/__pycache__/bus.cpython-311.pyc +0 -0
  147. space_classy-0.8/classy/taxonomies/__pycache__/bus.cpython-39.pyc +0 -0
  148. space_classy-0.8/classy/taxonomies/__pycache__/demeo.cpython-310.pyc +0 -0
  149. space_classy-0.8/classy/taxonomies/__pycache__/demeo.cpython-311.pyc +0 -0
  150. space_classy-0.8/classy/taxonomies/__pycache__/demeo.cpython-39.pyc +0 -0
  151. space_classy-0.8/classy/taxonomies/__pycache__/mahlke.cpython-310.pyc +0 -0
  152. space_classy-0.8/classy/taxonomies/__pycache__/mahlke.cpython-311.pyc +0 -0
  153. space_classy-0.8/classy/taxonomies/__pycache__/mahlke.cpython-39.pyc +0 -0
  154. space_classy-0.8/classy/taxonomies/__pycache__/tholen.cpython-310.pyc +0 -0
  155. space_classy-0.8/classy/taxonomies/__pycache__/tholen.cpython-311.pyc +0 -0
  156. space_classy-0.8/classy/taxonomies/__pycache__/tholen.cpython-39.pyc +0 -0
  157. {space_classy-0.7 → space_classy-0.8}/classy/taxonomies/demeo.py +17 -14
  158. space_classy-0.7/classy/taxonomies/mahlke.py → space_classy-0.8/classy/taxonomies/mahlke/__init__.py +37 -13
  159. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/__init__.cpython-311.pyc +0 -0
  160. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/__init__.cpython-39.pyc +0 -0
  161. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/decision_tree.cpython-311.pyc +0 -0
  162. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/decision_tree.cpython-39.pyc +0 -0
  163. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/defs.cpython-39.pyc +0 -0
  164. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/gmm.cpython-311.pyc +0 -0
  165. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/gmm.cpython-39.pyc +0 -0
  166. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/mixnorm.cpython-311.pyc +0 -0
  167. space_classy-0.8/classy/taxonomies/mahlke/__pycache__/mixnorm.cpython-39.pyc +0 -0
  168. {space_classy-0.7/classy → space_classy-0.8/classy/taxonomies/mahlke}/decision_tree.py +31 -29
  169. {space_classy-0.7/classy → space_classy-0.8/classy/taxonomies/mahlke}/defs.py +0 -23
  170. {space_classy-0.7/classy → space_classy-0.8/classy/taxonomies/mahlke}/gmm.py +16 -18
  171. {space_classy-0.7/classy → space_classy-0.8/classy/taxonomies/mahlke}/mixnorm.py +9 -13
  172. {space_classy-0.7 → space_classy-0.8}/classy/taxonomies/tholen.py +16 -10
  173. space_classy-0.8/classy/utils/__init__.py +95 -0
  174. space_classy-0.8/classy/utils/__pycache__/__init__.cpython-39.pyc +0 -0
  175. space_classy-0.8/classy/utils/__pycache__/download.cpython-39.pyc +0 -0
  176. space_classy-0.8/classy/utils/__pycache__/logging.cpython-39.pyc +0 -0
  177. space_classy-0.7/classy/tools.py → space_classy-0.8/classy/utils/download.py +19 -65
  178. {space_classy-0.7/classy → space_classy-0.8/classy/utils}/progress.py +8 -0
  179. {space_classy-0.7 → space_classy-0.8}/pyproject.toml +13 -23
  180. {space_classy-0.7 → space_classy-0.8}/setup.py +12 -18
  181. space_classy-0.7/classy/cache.py +0 -130
  182. space_classy-0.7/classy/classify.py +0 -235
  183. space_classy-0.7/classy/cli.py +0 -188
  184. space_classy-0.7/classy/config.py +0 -21
  185. space_classy-0.7/classy/core.py +0 -740
  186. space_classy-0.7/classy/feature.py +0 -586
  187. space_classy-0.7/classy/index.py +0 -395
  188. space_classy-0.7/classy/plotting.py +0 -840
  189. space_classy-0.7/classy/sources/cds/__init__.py +0 -40
  190. {space_classy-0.7 → space_classy-0.8}/LICENSE +0 -0
  191. {space_classy-0.7 → space_classy-0.8}/classy/data/classy/classy_data.csv +0 -0
  192. {space_classy-0.7 → space_classy-0.8}/classy/data/input/classy_data_classified.csv +0 -0
  193. {space_classy-0.7 → space_classy-0.8}/classy/data/input/classy_data_preprocessed.csv +0 -0
  194. {space_classy-0.7 → space_classy-0.8}/classy/data/mcfa/mcfa.pkl +0 -0
  195. {space_classy-0.7 → space_classy-0.8}/classy/data/mixnorm/mixnorm.pkl +0 -0
  196. {space_classy-0.7 → space_classy-0.8}/classy/data/mixnorm/neighbours.csv +0 -0
  197. {space_classy-0.7 → space_classy-0.8}/classy/data/nironly_1_classified.csv +0 -0
  198. {space_classy-0.7 → space_classy-0.8}/classy/sources/pds/hendrix_iue.py +0 -0
  199. {space_classy-0.7 → space_classy-0.8}/classy/taxonomies/bus.py +0 -0
  200. /space_classy-0.7/classy/log.py → /space_classy-0.8/classy/utils/logging.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: space-classy
3
- Version: 0.7
3
+ Version: 0.8
4
4
  Summary: classification tool for minor bodies using reflectance spectra and visual albedos
5
5
  Home-page: https://github.com/maxmahlke/classy
6
6
  License: MIT
@@ -14,26 +14,17 @@ Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Provides-Extra: docs
17
+ Provides-Extra: gui
17
18
  Requires-Dist: aiohttp (>=3.8)
18
19
  Requires-Dist: click (>=8.1.2)
19
- Requires-Dist: furo (>=2022.9.15,<2023.0.0)
20
- Requires-Dist: importlib-resources (>=5.10.2,<6.0.0)
21
- Requires-Dist: jinja2 (<3.1)
22
- Requires-Dist: lmfit (>=1.2.0,<2.0.0)
20
+ Requires-Dist: importlib-resources (>=5.10.2)
21
+ Requires-Dist: lmfit (>=1.2.0)
23
22
  Requires-Dist: mcfa (>=0.1,<0.2)
24
23
  Requires-Dist: numpy (>=1.22.3)
25
- Requires-Dist: pandas (>=1.4.2,<2.0.0)
26
- Requires-Dist: pyqt5 (>=5.15.9)
27
- Requires-Dist: pyqtgraph (>=0.13)
24
+ Requires-Dist: pandas (>=1.4.2)
28
25
  Requires-Dist: rich (>=12.2.0)
29
- Requires-Dist: scikit-learn (>=1.2.1,<2.0.0)
26
+ Requires-Dist: scikit-learn (>=1.2.1)
30
27
  Requires-Dist: space-rocks (>=1.7.2)
31
- Requires-Dist: sphinx (>=4,<5); extra == "docs"
32
- Requires-Dist: sphinx-copybutton (>=0.5.0,<0.6.0)
33
- Requires-Dist: sphinx-hoverxref
34
- Requires-Dist: sphinx-redactor-theme (>=0.0.1,<0.0.2); extra == "docs"
35
- Requires-Dist: sphinx_design (>=0.3.0,<0.4.0)
36
- Requires-Dist: tox (>=4.4.5,<5.0.0)
37
28
  Project-URL: Documentation, https://classy.readthedocs.io/en/latest/
38
29
  Project-URL: Repository, https://github.com/maxmahlke/classy.git
39
30
  Description-Content-Type: text/markdown
@@ -108,6 +99,8 @@ or
108
99
  $ pip install space-classy
109
100
  ```
110
101
 
102
+ To use interactive GUI features, you'll also need to install one of these packages to work with pyqtgraph: PyQt5, PyQt6, PySide2, or PySide6. Running `pip install space-classy[gui]` will automatically install space-classy alone with one of the necessary GUI libraries.
103
+
111
104
  # Documentation
112
105
 
113
106
  Check out the documentation at [classy.readthedocs.io](https://classy.readthedocs.io/en/latest/).
@@ -68,6 +68,8 @@ or
68
68
  $ pip install space-classy
69
69
  ```
70
70
 
71
+ To use interactive GUI features, you'll also need to install one of these packages to work with pyqtgraph: PyQt5, PyQt6, PySide2, or PySide6. Running `pip install space-classy[gui]` will automatically install space-classy alone with one of the necessary GUI libraries.
72
+
71
73
  # Documentation
72
74
 
73
75
  Check out the documentation at [classy.readthedocs.io](https://classy.readthedocs.io/en/latest/).
@@ -3,9 +3,9 @@ import os
3
3
 
4
4
  os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
5
5
 
6
- from .log import set_log_level
7
- from .core import Spectrum
8
- from .core import Spectra
6
+ from .utils.logging import set_log_level # noqa
7
+ from .core import Spectrum # noqa
8
+ from .core import Spectra # noqa
9
9
 
10
10
  # Welcome to classy
11
- __version__ = "0.7"
11
+ __version__ = "0.8"
@@ -0,0 +1,287 @@
1
+ from pathlib import Path
2
+ import sys
3
+ import webbrowser
4
+
5
+ import click
6
+ import rich
7
+ from rich.table import Table
8
+ import rocks
9
+
10
+ import classy
11
+ from classy import index
12
+ from classy import sources
13
+
14
+
15
+ @click.group()
16
+ @click.version_option(version=classy.__version__, message="%(version)s")
17
+ def cli_classy():
18
+ """CLI for minor body classification."""
19
+ pass
20
+
21
+
22
+ @cli_classy.command()
23
+ @click.argument("path", type=str)
24
+ def add(path):
25
+ """Add a local spectra collection."""
26
+ path = Path(path)
27
+
28
+ if not path.is_file():
29
+ click.echo("You need to pass the path of an index CSV file.")
30
+ sys.exit()
31
+
32
+ sources.private.parse_index(path)
33
+
34
+
35
+ @cli_classy.command(context_settings=dict(ignore_unknown_options=True))
36
+ @click.argument("args", type=click.UNPROCESSED, nargs=-1)
37
+ @click.option(
38
+ "-t",
39
+ "--taxonomy",
40
+ type=click.Choice(classy.taxonomies.SYSTEMS, case_sensitive=False),
41
+ help="Taxonomic system shown in output plot.",
42
+ default="mahlke",
43
+ )
44
+ @click.option("-p", "--plot", is_flag=True, help="Plot the classification result.")
45
+ @click.option("-s", "--save", help="Save plot under specified filename.")
46
+ def classify(args, taxonomy, plot, save):
47
+ """Classify spectra in classy index."""
48
+
49
+ if not args:
50
+ raise ValueError("No query parameters were specified.")
51
+
52
+ id, kwargs = _parse_args(args)
53
+ spectra = classy.Spectra(id, **kwargs)
54
+
55
+ if not spectra:
56
+ click.echo("No spectra matching these criteria found.")
57
+ sys.exit()
58
+
59
+ classy.set_log_level("CRITICAL")
60
+ for t in ["mahlke", "demeo", "tholen"]:
61
+ spectra.classify(taxonomy=t)
62
+ classy.set_log_level("WARNING")
63
+
64
+ # Echo result
65
+ table, columns = _create_table(spectra, classify=True)
66
+
67
+ for spec in spectra:
68
+ row = []
69
+
70
+ # TODO: Definition of code smell
71
+ for c in columns:
72
+ if c in ["name", "number", "albedo"]:
73
+ if hasattr(spec, "target"):
74
+ if c == "albedo":
75
+ row.append(str(spec.target.albedo.value))
76
+ else:
77
+ row.append(str(getattr(spec.target, c)))
78
+ else:
79
+ row.append("-")
80
+ elif c == "wave_min":
81
+ row.append(f"{spec.wave.min():.3f}")
82
+ elif c == "wave_max":
83
+ row.append(f"{spec.wave.max():.3f}")
84
+ else:
85
+ row.append(str(getattr(spec, c)))
86
+ table.add_row(*row)
87
+
88
+ rich.print(table)
89
+
90
+ # Plot
91
+ if plot:
92
+ spectra.plot(save=save, taxonomy=taxonomy)
93
+
94
+
95
+ @cli_classy.command()
96
+ def docs():
97
+ """Open documentation in browser."""
98
+ webbrowser.open("https://classy.readthedocs.io/en/latest/", new=2)
99
+
100
+
101
+ @cli_classy.command(context_settings=dict(ignore_unknown_options=True))
102
+ @click.argument("args", type=click.UNPROCESSED, nargs=-1)
103
+ @click.option("--feature", help="The feature to fit.")
104
+ @click.option(
105
+ "-f", "--force", is_flag=True, help="Include spectra with feature parameters."
106
+ )
107
+ def features(args, feature, force):
108
+ """Run interactive feature detection for selected spectra."""
109
+ if not args:
110
+ raise ValueError("No query parameters were specified.")
111
+
112
+ id, kwargs = _parse_args(args)
113
+ spectra = classy.Spectra(id, **kwargs)
114
+
115
+ if not spectra:
116
+ click.echo("No spectra matching these criteria found.")
117
+ sys.exit()
118
+
119
+ feature = feature.split(",") if feature is not None else "all"
120
+ spectra.inspect_features(feature, force=force, progress=True)
121
+
122
+
123
+ @cli_classy.command(context_settings=dict(ignore_unknown_options=True))
124
+ @click.argument("args", type=click.UNPROCESSED, nargs=-1)
125
+ @click.option(
126
+ "-f", "--force", is_flag=True, help="Include spectra with smoothing parameters."
127
+ )
128
+ def smooth(args, force):
129
+ """Run interactive smoothing for selected spectra."""
130
+ if not args:
131
+ raise ValueError("No query parameters were specified.")
132
+
133
+ id, kwargs = _parse_args(args)
134
+ spectra = classy.Spectra(id, **kwargs)
135
+
136
+ if not spectra:
137
+ click.echo("No spectra matching these criteria found.")
138
+ sys.exit()
139
+
140
+ spectra.smooth(force=force, progress=True)
141
+
142
+
143
+ @cli_classy.command(context_settings=dict(ignore_unknown_options=True))
144
+ @click.argument("args", type=click.UNPROCESSED, nargs=-1)
145
+ @click.option("-p", "--plot", is_flag=True, help="Plot the spectra.")
146
+ @click.option("-s", "--save", help="Save plot under specified filename.")
147
+ def spectra(args, plot, save):
148
+ """Search for spectra in classy index."""
149
+
150
+ if not args:
151
+ raise ValueError("No query parameters were specified.")
152
+
153
+ id, kwargs = _parse_args(args)
154
+ spectra = index.query(id, **kwargs)
155
+
156
+ if spectra.empty:
157
+ click.echo("No spectra matching these criteria found.")
158
+ sys.exit()
159
+
160
+ # Echo result
161
+ table, columns = _create_table(spectra)
162
+
163
+ for _, spec in spectra.iterrows():
164
+ table.add_row(*spec[columns].astype(str))
165
+
166
+ rich.print(table)
167
+
168
+ # Plot
169
+ if plot:
170
+ classy.Spectra(id, **kwargs).plot(save=save)
171
+
172
+
173
+ @cli_classy.command()
174
+ def status():
175
+ """Manage the index of asteroid spectra."""
176
+ from rich import prompt
177
+
178
+ # ------
179
+ # Echo inventory
180
+ index.data.echo_inventory()
181
+
182
+ # ------
183
+ # Download all or clear
184
+ decision = prompt.Prompt.ask(
185
+ "Choose one of these actions:\n"
186
+ "[blue][0][/blue] Do nothing "
187
+ "[blue][1][/blue] Manage cache "
188
+ "[blue][2][/blue] Retrieve public spectra",
189
+ choices=["0", "1", "2"],
190
+ show_choices=False,
191
+ default="0",
192
+ )
193
+
194
+ if decision == "1":
195
+ # Cache management dialog
196
+ decision = prompt.Prompt.ask(
197
+ "\nChoose one of these actions:\n"
198
+ "[blue][0][/blue] Do nothing "
199
+ "[blue][1][/blue] Rebuild index "
200
+ "[blue][2][/blue] Add phase angles "
201
+ "[blue][3][/blue] Clear cache",
202
+ choices=["0", "1", "2", "3"],
203
+ show_choices=False,
204
+ default="0",
205
+ )
206
+
207
+ if decision == "1":
208
+ rich.print()
209
+ rocks.set_log_level("CRITICAL")
210
+ classy.set_log_level("CRITICAL")
211
+ index.build()
212
+
213
+ if decision == "2":
214
+ index.add_phase_angles()
215
+
216
+ if decision == "3":
217
+ confirm = prompt.Confirm.ask(
218
+ "\nThis will delete the cache directory and all its contents,\n"
219
+ "[bold]including the preprocessing- and feature parameters[/bold]. Are you sure?",
220
+ )
221
+
222
+ if confirm:
223
+ index.data.remove()
224
+
225
+ elif decision == "2":
226
+ rich.print()
227
+ rocks.set_log_level("CRITICAL")
228
+ # classy.set_log_level("CRITICAL")
229
+ sources._retrieve_spectra()
230
+ index.build()
231
+
232
+ add_phase = prompt.Confirm.ask(
233
+ "\nAdd phase angles? [requires internet connection]"
234
+ )
235
+
236
+ if add_phase:
237
+ index.batch_phase()
238
+
239
+
240
+ # ------
241
+ # Utility functions
242
+ def _parse_args(args):
243
+ """Separate identifiers and option key-value pairs from arguments."""
244
+
245
+ # Separate query parameters and identifiers
246
+ idx_options = [i for i, arg in enumerate(args) if arg.startswith("--")]
247
+ kwargs = (
248
+ {args[i].strip("--"): args[i + 1] for i in idx_options} if idx_options else {}
249
+ )
250
+
251
+ id = args[: min(idx_options)] if idx_options else args
252
+ id = None if not id else id
253
+ return id, kwargs
254
+
255
+
256
+ def _create_table(spectra, classify=False):
257
+ """Create Table instance to echo query results."""
258
+ table = Table(
259
+ box=rich.box.ASCII2,
260
+ caption=f"{len(spectra)} Spectr{'a' if len(spectra) > 1 else 'um'}",
261
+ )
262
+
263
+ # Construct column setup
264
+ columns = ["name", "number", "wave_min", "wave_max"]
265
+
266
+ if not classify:
267
+ for c in ["date_obs", "phase", "source"]:
268
+ columns.insert(4, c)
269
+
270
+ for col in spectra.columns:
271
+ if col not in classy.index.COLUMNS:
272
+ columns += [col]
273
+
274
+ for c in columns:
275
+ if spectra[c].dtype == "float64":
276
+ spectra[c] = spectra[c].round(3)
277
+ if spectra[c].dtype in ["float64", "object"]:
278
+ spectra[c] = spectra[c].fillna("-")
279
+ else:
280
+ columns += ["albedo", "class_mahlke", "class_demeo", "class_tholen"]
281
+
282
+ columns += ["shortbib"]
283
+
284
+ for c in columns:
285
+ table.add_column(c)
286
+
287
+ return table, columns
@@ -0,0 +1,21 @@
1
+ """User-specific configuration in classy."""
2
+
3
+ import os
4
+ from pathlib import Path
5
+
6
+ from classy.utils.logging import logger
7
+ from platformdirs import user_cache_dir
8
+
9
+ # Data Directory
10
+ if "CLASSY_DATA_DIR" in os.environ:
11
+ PATH_DATA = Path(os.environ["CLASSY_DATA_DIR"]).expanduser().absolute()
12
+
13
+ if not PATH_DATA.is_dir():
14
+ raise ValueError(f"Path {PATH_DATA} does not exist.")
15
+ else:
16
+ PATH_DATA = Path(user_cache_dir()) / "classy"
17
+
18
+ logger.debug(f"classy data directory: {PATH_DATA}")
19
+
20
+ # Maximum missing wavelength range to extrapolate for classification
21
+ EXTRAPOLATION_LIMIT = 10 # in percent