tomtoolkit 2.30.0a0__py3-none-any.whl
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.
- tom_alerts/__init__.py +0 -0
- tom_alerts/admin.py +7 -0
- tom_alerts/alerts.py +275 -0
- tom_alerts/apps.py +12 -0
- tom_alerts/brokers/__init__.py +0 -0
- tom_alerts/brokers/alerce.py +636 -0
- tom_alerts/brokers/antares.py +50 -0
- tom_alerts/brokers/fink.py +44 -0
- tom_alerts/brokers/gaia.py +197 -0
- tom_alerts/brokers/hermes.py +44 -0
- tom_alerts/brokers/lasair.py +229 -0
- tom_alerts/brokers/scout.py +96 -0
- tom_alerts/brokers/tns.py +240 -0
- tom_alerts/exceptions.py +4 -0
- tom_alerts/management/__init__.py +0 -0
- tom_alerts/management/commands/__init__.py +0 -0
- tom_alerts/management/commands/runbrokerquery.py +33 -0
- tom_alerts/migrations/0001_initial.py +25 -0
- tom_alerts/migrations/0002_auto_20190626_2135.py +23 -0
- tom_alerts/migrations/0003_auto_20190701_2226.py +18 -0
- tom_alerts/migrations/0004_auto_20210204_2300.py +18 -0
- tom_alerts/migrations/0005_alertstreammessage.py +23 -0
- tom_alerts/migrations/0006_alter_alertstreammessage_exchange_status.py +18 -0
- tom_alerts/migrations/0007_alter_alertstreammessage_message_id.py +18 -0
- tom_alerts/migrations/__init__.py +0 -0
- tom_alerts/models.py +83 -0
- tom_alerts/templates/tom_alerts/brokerquery_confirm_delete.html +9 -0
- tom_alerts/templates/tom_alerts/brokerquery_list.html +49 -0
- tom_alerts/templates/tom_alerts/partials/navbar_link.html +3 -0
- tom_alerts/templates/tom_alerts/partials/submit_upstream_form.html +2 -0
- tom_alerts/templates/tom_alerts/query_form.html +7 -0
- tom_alerts/templates/tom_alerts/query_result.html +70 -0
- tom_alerts/templatetags/alerts_extras.py +36 -0
- tom_alerts/tests/__init__.py +0 -0
- tom_alerts/tests/brokers/__init__.py +0 -0
- tom_alerts/tests/brokers/test_alerce.py +569 -0
- tom_alerts/tests/brokers/test_gaia.py +188 -0
- tom_alerts/tests/brokers/test_lasair.py +96 -0
- tom_alerts/tests/tests.py +343 -0
- tom_alerts/urls.py +16 -0
- tom_alerts/views.py +394 -0
- tom_base/__init__.py +2 -0
- tom_base/settings.py +352 -0
- tom_base/wsgi.py +16 -0
- tom_catalogs/__init__.py +0 -0
- tom_catalogs/admin.py +1 -0
- tom_catalogs/apps.py +18 -0
- tom_catalogs/forms.py +41 -0
- tom_catalogs/harvester.py +86 -0
- tom_catalogs/harvesters/__init__.py +0 -0
- tom_catalogs/harvesters/jplhorizons.py +64 -0
- tom_catalogs/harvesters/mpc.py +200 -0
- tom_catalogs/harvesters/ned.py +27 -0
- tom_catalogs/harvesters/simbad.py +52 -0
- tom_catalogs/harvesters/tns.py +78 -0
- tom_catalogs/templates/tom_catalogs/partials/catalog_query_menu.html +4 -0
- tom_catalogs/templates/tom_catalogs/query_form.html +13 -0
- tom_catalogs/templatetags/__init__.py +0 -0
- tom_catalogs/templatetags/dataservices_extras.py +17 -0
- tom_catalogs/tests/__init__.py +0 -0
- tom_catalogs/tests/harvesters/__init__.py +0 -0
- tom_catalogs/tests/harvesters/data/__init__.py +0 -0
- tom_catalogs/tests/harvesters/data/test_65803_mpc_orb.json +284 -0
- tom_catalogs/tests/harvesters/test_jplhorizons.py +72 -0
- tom_catalogs/tests/harvesters/test_mpc.py +421 -0
- tom_catalogs/tests/harvesters/test_simbad.py +61 -0
- tom_catalogs/tests/tests.py +51 -0
- tom_catalogs/urls.py +9 -0
- tom_catalogs/views.py +39 -0
- tom_common/__init__.py +0 -0
- tom_common/admin.py +23 -0
- tom_common/api_router.py +54 -0
- tom_common/api_views.py +15 -0
- tom_common/apps.py +34 -0
- tom_common/exceptions.py +5 -0
- tom_common/forms.py +119 -0
- tom_common/hints.py +14 -0
- tom_common/hooks.py +33 -0
- tom_common/middleware.py +60 -0
- tom_common/migrations/0001_initial.py +25 -0
- tom_common/migrations/0002_usersession.py +25 -0
- tom_common/migrations/__init__.py +0 -0
- tom_common/mixins.py +13 -0
- tom_common/models.py +188 -0
- tom_common/serializers.py +11 -0
- tom_common/session_utils.py +351 -0
- tom_common/signals.py +168 -0
- tom_common/static/font-awesome-4.7.0/HELP-US-OUT.txt +7 -0
- tom_common/static/font-awesome-4.7.0/css/font-awesome.css +2337 -0
- tom_common/static/font-awesome-4.7.0/css/font-awesome.min.css +4 -0
- tom_common/static/font-awesome-4.7.0/fonts/FontAwesome.otf +0 -0
- tom_common/static/font-awesome-4.7.0/fonts/fontawesome-webfont.eot +0 -0
- tom_common/static/font-awesome-4.7.0/fonts/fontawesome-webfont.svg +2671 -0
- tom_common/static/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf +0 -0
- tom_common/static/font-awesome-4.7.0/fonts/fontawesome-webfont.woff +0 -0
- tom_common/static/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 +0 -0
- tom_common/static/font-awesome-4.7.0/less/animated.less +34 -0
- tom_common/static/font-awesome-4.7.0/less/bordered-pulled.less +25 -0
- tom_common/static/font-awesome-4.7.0/less/core.less +12 -0
- tom_common/static/font-awesome-4.7.0/less/fixed-width.less +6 -0
- tom_common/static/font-awesome-4.7.0/less/font-awesome.less +18 -0
- tom_common/static/font-awesome-4.7.0/less/icons.less +789 -0
- tom_common/static/font-awesome-4.7.0/less/larger.less +13 -0
- tom_common/static/font-awesome-4.7.0/less/list.less +19 -0
- tom_common/static/font-awesome-4.7.0/less/mixins.less +60 -0
- tom_common/static/font-awesome-4.7.0/less/path.less +15 -0
- tom_common/static/font-awesome-4.7.0/less/rotated-flipped.less +20 -0
- tom_common/static/font-awesome-4.7.0/less/screen-reader.less +5 -0
- tom_common/static/font-awesome-4.7.0/less/stacked.less +20 -0
- tom_common/static/font-awesome-4.7.0/less/variables.less +800 -0
- tom_common/static/font-awesome-4.7.0/scss/_animated.scss +34 -0
- tom_common/static/font-awesome-4.7.0/scss/_bordered-pulled.scss +25 -0
- tom_common/static/font-awesome-4.7.0/scss/_core.scss +12 -0
- tom_common/static/font-awesome-4.7.0/scss/_fixed-width.scss +6 -0
- tom_common/static/font-awesome-4.7.0/scss/_icons.scss +789 -0
- tom_common/static/font-awesome-4.7.0/scss/_larger.scss +13 -0
- tom_common/static/font-awesome-4.7.0/scss/_list.scss +19 -0
- tom_common/static/font-awesome-4.7.0/scss/_mixins.scss +60 -0
- tom_common/static/font-awesome-4.7.0/scss/_path.scss +15 -0
- tom_common/static/font-awesome-4.7.0/scss/_rotated-flipped.scss +20 -0
- tom_common/static/font-awesome-4.7.0/scss/_screen-reader.scss +5 -0
- tom_common/static/font-awesome-4.7.0/scss/_stacked.scss +20 -0
- tom_common/static/font-awesome-4.7.0/scss/_variables.scss +800 -0
- tom_common/static/font-awesome-4.7.0/scss/font-awesome.scss +18 -0
- tom_common/static/tom_common/css/dark.css +22 -0
- tom_common/static/tom_common/css/main.css +214 -0
- tom_common/static/tom_common/img/bluespinner.gif +0 -0
- tom_common/static/tom_common/img/favicon-16.ico +0 -0
- tom_common/static/tom_common/img/favicon-16x16.png +0 -0
- tom_common/static/tom_common/img/favicon-32.ico +0 -0
- tom_common/static/tom_common/img/favicon-32x32.png +0 -0
- tom_common/static/tom_common/img/favicon.ico +0 -0
- tom_common/static/tom_common/img/icon.png +0 -0
- tom_common/static/tom_common/img/logo-color-cropped.png +0 -0
- tom_common/static/tom_common/img/logo-color.png +0 -0
- tom_common/static/tom_common/img/logo-text.png +0 -0
- tom_common/static/tom_common/js/htmx.min.js +1 -0
- tom_common/templates/auth/group_confirm_delete.html +9 -0
- tom_common/templates/auth/group_form.html +17 -0
- tom_common/templates/auth/partials/app_user_lists.html +5 -0
- tom_common/templates/auth/partials/group_list.html +23 -0
- tom_common/templates/auth/partials/user_list.html +33 -0
- tom_common/templates/auth/user_confirm_change_password.html +11 -0
- tom_common/templates/auth/user_confirm_delete.html +10 -0
- tom_common/templates/auth/user_list.html +9 -0
- tom_common/templates/bootstrap4_overrides/pagination.html +42 -0
- tom_common/templates/comments/form.html +16 -0
- tom_common/templates/comments/list.html +23 -0
- tom_common/templates/django_comments/comment_confirm_delete.html +11 -0
- tom_common/templates/django_filters/widgets/multiwidget.html +10 -0
- tom_common/templates/registration/login.html +16 -0
- tom_common/templates/tom_common/base.html +76 -0
- tom_common/templates/tom_common/change_user_password.html +14 -0
- tom_common/templates/tom_common/create_user.html +27 -0
- tom_common/templates/tom_common/index.html +50 -0
- tom_common/templates/tom_common/navbar_content.html +41 -0
- tom_common/templates/tom_common/partials/app_profiles.html +23 -0
- tom_common/templates/tom_common/partials/confirm_user_delete.html +24 -0
- tom_common/templates/tom_common/partials/copy_button.html +19 -0
- tom_common/templates/tom_common/partials/include_app_partial.html +7 -0
- tom_common/templates/tom_common/partials/navbar_app_addons.html +4 -0
- tom_common/templates/tom_common/partials/navbar_login.html +18 -0
- tom_common/templates/tom_common/partials/user_data.html +32 -0
- tom_common/templates/tom_common/user_profile.html +16 -0
- tom_common/templatetags/__init__.py +0 -0
- tom_common/templatetags/bootstrap4_overrides.py +36 -0
- tom_common/templatetags/tom_common_extras.py +197 -0
- tom_common/templatetags/user_extras.py +119 -0
- tom_common/tests.py +620 -0
- tom_common/urls.py +74 -0
- tom_common/views.py +335 -0
- tom_dataproducts/__init__.py +0 -0
- tom_dataproducts/admin.py +7 -0
- tom_dataproducts/alertstreams/__init__.py +0 -0
- tom_dataproducts/alertstreams/hermes.py +413 -0
- tom_dataproducts/api_views.py +94 -0
- tom_dataproducts/apps.py +5 -0
- tom_dataproducts/data_processor.py +124 -0
- tom_dataproducts/exceptions.py +2 -0
- tom_dataproducts/filters.py +52 -0
- tom_dataproducts/forms.py +66 -0
- tom_dataproducts/hooks.py +24 -0
- tom_dataproducts/management/__init__.py +0 -0
- tom_dataproducts/management/commands/__init__.py +0 -0
- tom_dataproducts/management/commands/downloaddata.py +19 -0
- tom_dataproducts/management/commands/updatereduceddata.py +49 -0
- tom_dataproducts/migrations/0001_initial.py +77 -0
- tom_dataproducts/migrations/0004_auto_20190626_0904.py +23 -0
- tom_dataproducts/migrations/0005_auto_20190704_1010.py +29 -0
- tom_dataproducts/migrations/0006_auto_20190912_2013.py +18 -0
- tom_dataproducts/migrations/0007_manual_20191016_rename_type.py +37 -0
- tom_dataproducts/migrations/0008_auto_20191205_1952.py +27 -0
- tom_dataproducts/migrations/0009_auto_20210204_2221.py +18 -0
- tom_dataproducts/migrations/0010_manual_20210305_fix_spectroscopy.py +43 -0
- tom_dataproducts/migrations/0011_reduceddatum_message.py +19 -0
- tom_dataproducts/migrations/0012_alter_reduceddatum_data_product_and_more.py +29 -0
- tom_dataproducts/migrations/0013_alter_reduceddatum_message.py +19 -0
- tom_dataproducts/migrations/0014_alter_reduceddatum_timestamp.py +19 -0
- tom_dataproducts/migrations/__init__.py +0 -0
- tom_dataproducts/models.py +420 -0
- tom_dataproducts/processors/__init__.py +0 -0
- tom_dataproducts/processors/atlas_processor.py +92 -0
- tom_dataproducts/processors/data_serializers.py +38 -0
- tom_dataproducts/processors/panstarrs_processor.py +98 -0
- tom_dataproducts/processors/photometry_processor.py +65 -0
- tom_dataproducts/processors/spectroscopy_processor.py +137 -0
- tom_dataproducts/serializers.py +132 -0
- tom_dataproducts/sharing.py +379 -0
- tom_dataproducts/single_target_data_service/__init__.py +0 -0
- tom_dataproducts/single_target_data_service/atlas.py +173 -0
- tom_dataproducts/single_target_data_service/panstarrs_service/__init__.py +0 -0
- tom_dataproducts/single_target_data_service/panstarrs_service/panstarrs.py +235 -0
- tom_dataproducts/single_target_data_service/panstarrs_service/panstarrs_api.py +170 -0
- tom_dataproducts/single_target_data_service/panstarrs_service/tests.py +9 -0
- tom_dataproducts/single_target_data_service/single_target_data_service.py +145 -0
- tom_dataproducts/static/tom_dataproducts/img/placeholder.png +0 -0
- tom_dataproducts/static/tom_dataproducts/photometry_sample.csv +5 -0
- tom_dataproducts/static/tom_dataproducts/spectrum_sample.csv +7 -0
- tom_dataproducts/tasks.py +103 -0
- tom_dataproducts/templates/tom_dataproducts/add_product_to_group.html +12 -0
- tom_dataproducts/templates/tom_dataproducts/dataproduct_confirm_delete.html +12 -0
- tom_dataproducts/templates/tom_dataproducts/dataproduct_list.html +94 -0
- tom_dataproducts/templates/tom_dataproducts/dataproductgroup_confirm_delete.html +11 -0
- tom_dataproducts/templates/tom_dataproducts/dataproductgroup_detail.html +20 -0
- tom_dataproducts/templates/tom_dataproducts/dataproductgroup_form.html +12 -0
- tom_dataproducts/templates/tom_dataproducts/dataproductgroup_list.html +18 -0
- tom_dataproducts/templates/tom_dataproducts/partials/dataproduct_list_for_target.html +75 -0
- tom_dataproducts/templates/tom_dataproducts/partials/js9_button.html +1 -0
- tom_dataproducts/templates/tom_dataproducts/partials/js9_scripts.html +21 -0
- tom_dataproducts/templates/tom_dataproducts/partials/photometry_datalist_for_target.html +125 -0
- tom_dataproducts/templates/tom_dataproducts/partials/photometry_for_target.html +11 -0
- tom_dataproducts/templates/tom_dataproducts/partials/query_single_target_data_service.html +12 -0
- tom_dataproducts/templates/tom_dataproducts/partials/recent_photometry.html +29 -0
- tom_dataproducts/templates/tom_dataproducts/partials/reduceddatum_sparkline.html +3 -0
- tom_dataproducts/templates/tom_dataproducts/partials/saved_dataproduct_list_for_observation.html +37 -0
- tom_dataproducts/templates/tom_dataproducts/partials/spectroscopy_for_target.html +4 -0
- tom_dataproducts/templates/tom_dataproducts/partials/unsaved_dataproduct_list_for_observation.html +27 -0
- tom_dataproducts/templates/tom_dataproducts/partials/update_broker_data_button.html +1 -0
- tom_dataproducts/templates/tom_dataproducts/partials/upload_dataproduct.html +12 -0
- tom_dataproducts/templates/tom_dataproducts/single_target_data_service_form.html +24 -0
- tom_dataproducts/templates/tom_dataproducts/upload_reduced_data.html +12 -0
- tom_dataproducts/templatetags/__init__.py +0 -0
- tom_dataproducts/templatetags/dataproduct_extras.py +520 -0
- tom_dataproducts/tests/__init__.py +0 -0
- tom_dataproducts/tests/test_api.py +197 -0
- tom_dataproducts/tests/test_atlas.py +52 -0
- tom_dataproducts/tests/test_data/test_atlas_fp.csv +33 -0
- tom_dataproducts/tests/test_data/test_lightcurve.csv +4 -0
- tom_dataproducts/tests/test_data/test_spectrum.csv +3 -0
- tom_dataproducts/tests/test_data/test_spectrum.fits +231 -1
- tom_dataproducts/tests/test_sharing.py +173 -0
- tom_dataproducts/tests/tests.py +944 -0
- tom_dataproducts/urls.py +34 -0
- tom_dataproducts/utils.py +34 -0
- tom_dataproducts/views.py +536 -0
- tom_dataservices/__init__.py +0 -0
- tom_dataservices/admin.py +3 -0
- tom_dataservices/apps.py +33 -0
- tom_dataservices/data_services/lsst.py +133 -0
- tom_dataservices/data_services/tns.py +209 -0
- tom_dataservices/dataservices.py +286 -0
- tom_dataservices/forms.py +50 -0
- tom_dataservices/migrations/0001_initial.py +26 -0
- tom_dataservices/migrations/__init__.py +0 -0
- tom_dataservices/models.py +24 -0
- tom_dataservices/templates/tom_dataservices/dataservicequery_confirm_delete.html +9 -0
- tom_dataservices/templates/tom_dataservices/partials/catalog_query_menu.html +11 -0
- tom_dataservices/templates/tom_dataservices/partials/navbar_list.html +14 -0
- tom_dataservices/templates/tom_dataservices/partials/query_results_table.html +21 -0
- tom_dataservices/templates/tom_dataservices/query_form.html +58 -0
- tom_dataservices/templates/tom_dataservices/query_list.html +49 -0
- tom_dataservices/templates/tom_dataservices/query_result.html +45 -0
- tom_dataservices/templates/tom_dataservices/tns/partials/tns_query_results_table.html +24 -0
- tom_dataservices/templates/tom_dataservices/tns/partials/tns_simple_form.html +2 -0
- tom_dataservices/templatetags/dataservices_extras.py +22 -0
- tom_dataservices/tests/__init__.py +0 -0
- tom_dataservices/tests/test_api.py +5 -0
- tom_dataservices/tests/tests.py +113 -0
- tom_dataservices/urls.py +17 -0
- tom_dataservices/views.py +351 -0
- tom_observations/__init__.py +0 -0
- tom_observations/admin.py +26 -0
- tom_observations/api_views.py +186 -0
- tom_observations/apps.py +5 -0
- tom_observations/cadence.py +82 -0
- tom_observations/cadences/__init__.py +0 -0
- tom_observations/cadences/resume_cadence_after_failure.py +115 -0
- tom_observations/cadences/retry_failed_observations.py +66 -0
- tom_observations/facilities/__init__.py +0 -0
- tom_observations/facilities/blanco.py +233 -0
- tom_observations/facilities/gemini.py +523 -0
- tom_observations/facilities/lco.py +1140 -0
- tom_observations/facilities/lco_redirect.py +50 -0
- tom_observations/facilities/lt.py +70 -0
- tom_observations/facilities/manual.py +125 -0
- tom_observations/facilities/ocs.py +1630 -0
- tom_observations/facilities/soar.py +265 -0
- tom_observations/facility.py +635 -0
- tom_observations/forms.py +70 -0
- tom_observations/management/__init__.py +0 -0
- tom_observations/management/commands/__init__.py +0 -0
- tom_observations/management/commands/runcadencestrategies.py +51 -0
- tom_observations/management/commands/updatestatus.py +55 -0
- tom_observations/migrations/0001_initial.py +32 -0
- tom_observations/migrations/0002_auto_20190306_2343.py +23 -0
- tom_observations/migrations/0003_auto_20190503_2318.py +18 -0
- tom_observations/migrations/0004_observationgroup.py +23 -0
- tom_observations/migrations/0005_auto_20191210_0007.py +17 -0
- tom_observations/migrations/0006_observationgroup_cadence_strategy.py +18 -0
- tom_observations/migrations/0007_observationstrategy.py +24 -0
- tom_observations/migrations/0008_observationgroup_cadence_parameters.py +18 -0
- tom_observations/migrations/0009_observationrecord_user.py +21 -0
- tom_observations/migrations/0010_manual_create_dynamic_cadence.py +67 -0
- tom_observations/migrations/0011_auto_20200917_0306.py +26 -0
- tom_observations/migrations/0012_auto_20210205_1819.py +23 -0
- tom_observations/migrations/0013_facility.py +34 -0
- tom_observations/migrations/0014_alter_facility_orbit.py +18 -0
- tom_observations/migrations/0015_remove_facility_mpc_site_code_and_more.py +73 -0
- tom_observations/migrations/0016_alter_facility_options.py +17 -0
- tom_observations/migrations/__init__.py +0 -0
- tom_observations/models.py +335 -0
- tom_observations/observation_template.py +56 -0
- tom_observations/serializers.py +84 -0
- tom_observations/static/tom_observations/css/main.css +24 -0
- tom_observations/templates/tom_observations/existing_observation_confirm.html +7 -0
- tom_observations/templates/tom_observations/facility_status.html +10 -0
- tom_observations/templates/tom_observations/observation_form.html +64 -0
- tom_observations/templates/tom_observations/observation_list.html +89 -0
- tom_observations/templates/tom_observations/observationgroup_confirm_delete.html +12 -0
- tom_observations/templates/tom_observations/observationgroup_form.html +9 -0
- tom_observations/templates/tom_observations/observationgroup_list.html +48 -0
- tom_observations/templates/tom_observations/observationrecord_detail.html +90 -0
- tom_observations/templates/tom_observations/observationtemplate_confirm_delete.html +9 -0
- tom_observations/templates/tom_observations/observationtemplate_form.html +10 -0
- tom_observations/templates/tom_observations/observationtemplate_list.html +50 -0
- tom_observations/templates/tom_observations/observationupdate_form.html +7 -0
- tom_observations/templates/tom_observations/partials/existing_observation_form.html +3 -0
- tom_observations/templates/tom_observations/partials/facility_map.html +1 -0
- tom_observations/templates/tom_observations/partials/facility_observation_form.html +4 -0
- tom_observations/templates/tom_observations/partials/facility_status.html +33 -0
- tom_observations/templates/tom_observations/partials/observation_distribution.html +1 -0
- tom_observations/templates/tom_observations/partials/observation_list.html +25 -0
- tom_observations/templates/tom_observations/partials/observation_plan.html +4 -0
- tom_observations/templates/tom_observations/partials/observation_type_tabs.html +10 -0
- tom_observations/templates/tom_observations/partials/observationtemplate_from_record.html +1 -0
- tom_observations/templates/tom_observations/partials/observationtemplate_run.html +6 -0
- tom_observations/templates/tom_observations/partials/observing_buttons.html +7 -0
- tom_observations/templates/tom_observations/partials/update_observation_id_form.html +2 -0
- tom_observations/templates/tom_observations/partials/update_status_button.html +1 -0
- tom_observations/templatetags/__init__.py +0 -0
- tom_observations/templatetags/observation_extras.py +344 -0
- tom_observations/tests/__init__.py +0 -0
- tom_observations/tests/facilities/__init__.py +0 -0
- tom_observations/tests/facilities/test_gemini.py +32 -0
- tom_observations/tests/facilities/test_lco.py +717 -0
- tom_observations/tests/facilities/test_ocs.py +266 -0
- tom_observations/tests/facilities/test_soar.py +195 -0
- tom_observations/tests/factories.py +92 -0
- tom_observations/tests/test_api.py +295 -0
- tom_observations/tests/test_cadence.py +141 -0
- tom_observations/tests/test_credentials.py +164 -0
- tom_observations/tests/tests.py +493 -0
- tom_observations/tests/utils.py +161 -0
- tom_observations/urls.py +36 -0
- tom_observations/utils.py +186 -0
- tom_observations/views.py +815 -0
- tom_observations/widgets.py +50 -0
- tom_setup/__init__.py +0 -0
- tom_setup/apps.py +5 -0
- tom_setup/management/__init__.py +0 -0
- tom_setup/management/commands/__init__.py +0 -0
- tom_setup/management/commands/tom_setup.py +296 -0
- tom_setup/templates/tom_setup/css.tmpl +26 -0
- tom_setup/templates/tom_setup/models.tmpl +18 -0
- tom_setup/templates/tom_setup/settings.tmpl +383 -0
- tom_setup/templates/tom_setup/urls.tmpl +20 -0
- tom_targets/__init__.py +1 -0
- tom_targets/admin.py +34 -0
- tom_targets/api_views.py +127 -0
- tom_targets/apps.py +9 -0
- tom_targets/base_models.py +609 -0
- tom_targets/fields.py +14 -0
- tom_targets/filters.py +142 -0
- tom_targets/forms.py +307 -0
- tom_targets/groups.py +260 -0
- tom_targets/management/__init__.py +0 -0
- tom_targets/management/commands/__init__.py +0 -0
- tom_targets/management/commands/converttargetextras.py +179 -0
- tom_targets/management/commands/setdefaultextras.py +55 -0
- tom_targets/merge.py +90 -0
- tom_targets/migrations/0001_initial.py +68 -0
- tom_targets/migrations/0002_auto_20190115_2102.py +23 -0
- tom_targets/migrations/0002_auto_20190117_2248.py +23 -0
- tom_targets/migrations/0003_merge_20190123_1754.py +14 -0
- tom_targets/migrations/0004_auto_20190123_2010.py +31 -0
- tom_targets/migrations/0005_auto_20190214_1722.py +28 -0
- tom_targets/migrations/0006_auto_20190403_1659.py +23 -0
- tom_targets/migrations/0007_auto_20190423_1455.py +18 -0
- tom_targets/migrations/0007_auto_20190503_2318.py +18 -0
- tom_targets/migrations/0007_auto_20190515_0047.py +18 -0
- tom_targets/migrations/0008_merge_20190515_0914.py +14 -0
- tom_targets/migrations/0008_merge_20190520_1645.py +14 -0
- tom_targets/migrations/0009_auto_20190605_1656.py +17 -0
- tom_targets/migrations/0010_auto_20190715_1657.py +17 -0
- tom_targets/migrations/0010_merge_20190612_1227.py +14 -0
- tom_targets/migrations/0011_merge_20190731_1821.py +14 -0
- tom_targets/migrations/0012_target_perihdist.py +18 -0
- tom_targets/migrations/0013_manual_20190916_multiple_names.py +74 -0
- tom_targets/migrations/0014_auto_20190923_1827.py +33 -0
- tom_targets/migrations/0015_auto_20190923_2233.py +23 -0
- tom_targets/migrations/0016_auto_20191211_1707.py +18 -0
- tom_targets/migrations/0017_auto_20200130_2350.py +23 -0
- tom_targets/migrations/0018_auto_20200714_1832.py +18 -0
- tom_targets/migrations/0019_auto_20210811_0018.py +17 -0
- tom_targets/migrations/0020_alter_targetname_created_alter_targetname_modified.py +23 -0
- tom_targets/migrations/0021_rename_target_basetarget_alter_basetarget_options.py +23 -0
- tom_targets/migrations/0022_persistentshare.py +30 -0
- tom_targets/migrations/0023_alter_basetarget_created.py +18 -0
- tom_targets/migrations/0024_basetarget_permissions.py +18 -0
- tom_targets/migrations/0025_auto_20250206_2017.py +53 -0
- tom_targets/migrations/0026_alter_basetarget_permissions.py +18 -0
- tom_targets/migrations/0027_alter_basetarget_epoch_of_elements_and_more.py +33 -0
- tom_targets/migrations/0028_basetarget_abs_mag_basetarget_slope_and_more.py +23 -0
- tom_targets/migrations/0029_alter_basetarget_permissions.py +19 -0
- tom_targets/migrations/0030_alter_basetarget_slope.py +18 -0
- tom_targets/migrations/__init__.py +0 -0
- tom_targets/models.py +226 -0
- tom_targets/permissions.py +37 -0
- tom_targets/persistent_sharing_serializers.py +28 -0
- tom_targets/seed.py +123 -0
- tom_targets/serializers.py +181 -0
- tom_targets/sharing.py +123 -0
- tom_targets/signals/__init__.py +0 -0
- tom_targets/signals/handlers.py +23 -0
- tom_targets/static/tom_targets/css/main.css +17 -0
- tom_targets/static/tom_targets/target_import.csv +3 -0
- tom_targets/templates/tom_targets/partials/aladin_finderchart.html +178 -0
- tom_targets/templates/tom_targets/partials/aladin_skymap.html +127 -0
- tom_targets/templates/tom_targets/partials/app_tab_divs.html +6 -0
- tom_targets/templates/tom_targets/partials/app_tabs.html +6 -0
- tom_targets/templates/tom_targets/partials/create_persistent_share.html +90 -0
- tom_targets/templates/tom_targets/partials/module_buttons.html +4 -0
- tom_targets/templates/tom_targets/partials/moon_distance.html +3 -0
- tom_targets/templates/tom_targets/partials/persistent_share_table.html +59 -0
- tom_targets/templates/tom_targets/partials/recent_targets.html +38 -0
- tom_targets/templates/tom_targets/partials/recently_updated_targets.html +23 -0
- tom_targets/templates/tom_targets/partials/target_buttons.html +9 -0
- tom_targets/templates/tom_targets/partials/target_data.html +44 -0
- tom_targets/templates/tom_targets/partials/target_feature.html +17 -0
- tom_targets/templates/tom_targets/partials/target_groups.html +37 -0
- tom_targets/templates/tom_targets/partials/target_merge_fields.html +38 -0
- tom_targets/templates/tom_targets/partials/target_plan.html +11 -0
- tom_targets/templates/tom_targets/partials/target_table.html +61 -0
- tom_targets/templates/tom_targets/partials/target_unknown_statuses.html +5 -0
- tom_targets/templates/tom_targets/partials/targetlist_select.html +55 -0
- tom_targets/templates/tom_targets/target_confirm_delete.html +12 -0
- tom_targets/templates/tom_targets/target_detail.html +133 -0
- tom_targets/templates/tom_targets/target_facility_selection.html +68 -0
- tom_targets/templates/tom_targets/target_form.html +78 -0
- tom_targets/templates/tom_targets/target_group_share.html +70 -0
- tom_targets/templates/tom_targets/target_grouping.html +48 -0
- tom_targets/templates/tom_targets/target_import.html +26 -0
- tom_targets/templates/tom_targets/target_list.html +68 -0
- tom_targets/templates/tom_targets/target_manage_persistent_shares.html +20 -0
- tom_targets/templates/tom_targets/target_merge.html +24 -0
- tom_targets/templates/tom_targets/target_share.html +89 -0
- tom_targets/templates/tom_targets/targetlist_confirm_delete.html +11 -0
- tom_targets/templates/tom_targets/targetlist_form.html +9 -0
- tom_targets/templatetags/__init__.py +0 -0
- tom_targets/templatetags/targets_extras.py +569 -0
- tom_targets/tests/__init__.py +0 -0
- tom_targets/tests/factories.py +63 -0
- tom_targets/tests/test_api.py +303 -0
- tom_targets/tests/tests.py +2066 -0
- tom_targets/urls.py +59 -0
- tom_targets/utils.py +156 -0
- tom_targets/validators.py +23 -0
- tom_targets/views.py +1124 -0
- tom_targets/viewsets.py +49 -0
- tomtoolkit-2.30.0a0.dist-info/METADATA +164 -0
- tomtoolkit-2.30.0a0.dist-info/RECORD +483 -0
- tomtoolkit-2.30.0a0.dist-info/WHEEL +4 -0
- tomtoolkit-2.30.0a0.dist-info/licenses/LICENSE +674 -0
tom_alerts/__init__.py
ADDED
|
File without changes
|
tom_alerts/admin.py
ADDED
tom_alerts/alerts.py
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from importlib import import_module
|
|
5
|
+
|
|
6
|
+
from django import forms
|
|
7
|
+
from django.conf import settings
|
|
8
|
+
from django.shortcuts import reverse
|
|
9
|
+
from crispy_forms.bootstrap import StrictButton
|
|
10
|
+
from crispy_forms.helper import FormHelper
|
|
11
|
+
from crispy_forms.layout import Layout, Submit
|
|
12
|
+
|
|
13
|
+
from tom_alerts.models import BrokerQuery
|
|
14
|
+
from tom_observations.models import ObservationRecord
|
|
15
|
+
from tom_targets.models import Target
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
DEFAULT_ALERT_CLASSES = [
|
|
19
|
+
'tom_alerts.brokers.lasair.LasairBroker',
|
|
20
|
+
'tom_alerts.brokers.scout.ScoutBroker',
|
|
21
|
+
'tom_alerts.brokers.alerce.ALeRCEBroker',
|
|
22
|
+
'tom_alerts.brokers.antares.ANTARESBroker',
|
|
23
|
+
'tom_alerts.brokers.gaia.GaiaBroker',
|
|
24
|
+
'tom_alerts.brokers.fink.FinkBroker', # the stub for the plugin
|
|
25
|
+
'tom_alerts.brokers.hermes.HermesBroker', # the stub for the plugin
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_service_classes():
|
|
30
|
+
"""
|
|
31
|
+
Gets the broker classes available to this TOM as specified by ``TOM_ALERT_CLASSES`` in ``settings.py``. If none are
|
|
32
|
+
specified, returns the default set.
|
|
33
|
+
|
|
34
|
+
:returns: dict of broker classes, with keys being the name of the broker and values being the broker class
|
|
35
|
+
:rtype: dict
|
|
36
|
+
"""
|
|
37
|
+
try:
|
|
38
|
+
TOM_ALERT_CLASSES = settings.TOM_ALERT_CLASSES
|
|
39
|
+
except AttributeError:
|
|
40
|
+
TOM_ALERT_CLASSES = DEFAULT_ALERT_CLASSES
|
|
41
|
+
|
|
42
|
+
service_choices = {}
|
|
43
|
+
for service in TOM_ALERT_CLASSES:
|
|
44
|
+
mod_name, class_name = service.rsplit('.', 1)
|
|
45
|
+
try:
|
|
46
|
+
mod = import_module(mod_name)
|
|
47
|
+
clazz = getattr(mod, class_name)
|
|
48
|
+
except (ImportError, AttributeError):
|
|
49
|
+
raise ImportError(f'Could not import {service}. Did you provide the correct path?')
|
|
50
|
+
service_choices[clazz.name] = clazz
|
|
51
|
+
return service_choices
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def get_service_class(name):
|
|
55
|
+
"""
|
|
56
|
+
Gets the specific broker class for a given broker name.
|
|
57
|
+
|
|
58
|
+
:returns: Broker class
|
|
59
|
+
:rtype: class
|
|
60
|
+
"""
|
|
61
|
+
available_classes = get_service_classes()
|
|
62
|
+
try:
|
|
63
|
+
return available_classes[name]
|
|
64
|
+
except KeyError:
|
|
65
|
+
raise ImportError(
|
|
66
|
+
'''Could not a find a broker with that name.
|
|
67
|
+
Did you add it to TOM_ALERT_CLASSES?'''
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dataclass
|
|
72
|
+
class GenericAlert:
|
|
73
|
+
"""
|
|
74
|
+
dataclass representing an alert in order to display it in the UI.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
timestamp: datetime
|
|
78
|
+
id: int
|
|
79
|
+
name: str
|
|
80
|
+
ra: float
|
|
81
|
+
dec: float
|
|
82
|
+
mag: float
|
|
83
|
+
score: float
|
|
84
|
+
url: str
|
|
85
|
+
|
|
86
|
+
def to_target(self):
|
|
87
|
+
"""
|
|
88
|
+
Returns a Target instance for an object defined by an alert, as well as
|
|
89
|
+
any TargetExtra or additional TargetNames.
|
|
90
|
+
|
|
91
|
+
:returns: representation of object for an alert
|
|
92
|
+
:rtype: `Target`
|
|
93
|
+
|
|
94
|
+
:returns: dict of extras to be added to the new Target
|
|
95
|
+
:rtype: `dict`
|
|
96
|
+
|
|
97
|
+
:returns: list of aliases to be added to the new Target
|
|
98
|
+
:rtype: `list`
|
|
99
|
+
"""
|
|
100
|
+
return Target(
|
|
101
|
+
name=self.name,
|
|
102
|
+
type='SIDEREAL',
|
|
103
|
+
ra=self.ra,
|
|
104
|
+
dec=self.dec
|
|
105
|
+
), {}, []
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class GenericQueryForm(forms.Form):
|
|
109
|
+
"""
|
|
110
|
+
Form class representing the default form for a broker.
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
query_name = forms.CharField(required=True)
|
|
114
|
+
broker = forms.CharField(
|
|
115
|
+
required=True,
|
|
116
|
+
max_length=50,
|
|
117
|
+
widget=forms.HiddenInput()
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
def __init__(self, *args, **kwargs):
|
|
121
|
+
super().__init__(*args, **kwargs)
|
|
122
|
+
self.helper = FormHelper()
|
|
123
|
+
self.helper.add_input(Submit('submit', 'Submit'))
|
|
124
|
+
self.common_layout = Layout('query_name', 'broker')
|
|
125
|
+
|
|
126
|
+
def save(self, query_id=None):
|
|
127
|
+
"""
|
|
128
|
+
Saves the form data in the database as a ``BrokerQuery``.
|
|
129
|
+
|
|
130
|
+
:returns: ``BrokerQuery`` model representation of the form that was saved to the db
|
|
131
|
+
:rtype: ``BrokerQuery``
|
|
132
|
+
"""
|
|
133
|
+
if query_id:
|
|
134
|
+
query = BrokerQuery.objects.get(id=query_id)
|
|
135
|
+
else:
|
|
136
|
+
query = BrokerQuery()
|
|
137
|
+
query.name = self.cleaned_data['query_name']
|
|
138
|
+
query.broker = self.cleaned_data['broker']
|
|
139
|
+
query.parameters = self.cleaned_data
|
|
140
|
+
query.save()
|
|
141
|
+
return query
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class GenericUpstreamSubmissionForm(forms.Form):
|
|
145
|
+
target = forms.ModelChoiceField(required=False, queryset=Target.objects.all(), widget=forms.HiddenInput())
|
|
146
|
+
observation_record = forms.ModelChoiceField(required=False, queryset=ObservationRecord.objects.all(),
|
|
147
|
+
widget=forms.HiddenInput())
|
|
148
|
+
redirect_url = forms.CharField(required=False, max_length=100, widget=forms.HiddenInput())
|
|
149
|
+
|
|
150
|
+
def __init__(self, *args, **kwargs):
|
|
151
|
+
broker_name = kwargs.pop('broker') # NOTE: parent constructor is not expecting broker and will fail
|
|
152
|
+
super().__init__(*args, **kwargs)
|
|
153
|
+
self.helper = FormHelper()
|
|
154
|
+
self.helper.form_class = 'form-inline'
|
|
155
|
+
self.helper.form_action = reverse('tom_alerts:submit-alert', kwargs={'broker': broker_name})
|
|
156
|
+
self.helper.layout = Layout(
|
|
157
|
+
'target',
|
|
158
|
+
'observation_record',
|
|
159
|
+
'redirect_url',
|
|
160
|
+
StrictButton(f'Submit to {broker_name}', type='submit', css_class='btn-outline-primary'))
|
|
161
|
+
|
|
162
|
+
def clean(self):
|
|
163
|
+
cleaned_data = super().clean()
|
|
164
|
+
|
|
165
|
+
if not (cleaned_data.get('target') or cleaned_data.get('observation_record')):
|
|
166
|
+
raise forms.ValidationError('Must provide either Target or ObservationRecord to be submitted upstream.')
|
|
167
|
+
|
|
168
|
+
return cleaned_data
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class GenericBroker(ABC):
|
|
172
|
+
"""
|
|
173
|
+
The ``GenericBroker`` provides an interface for implementing a broker module. It contains a number of methods to be
|
|
174
|
+
implemented, but only the methods decorated with ``@abstractmethod`` are required to be implemented. In order to
|
|
175
|
+
make use of a broker module, add the path to ``TOM_ALERT_CLASSES`` in your ``settings.py``.
|
|
176
|
+
|
|
177
|
+
For an implementation example, please see
|
|
178
|
+
https://github.com/TOMToolkit/tom_base/blob/main/tom_alerts/brokers/mars.py
|
|
179
|
+
"""
|
|
180
|
+
alert_submission_form = GenericUpstreamSubmissionForm
|
|
181
|
+
score_description = "The meaning of this field changes between brokers, please consult this broker's documentation."
|
|
182
|
+
|
|
183
|
+
@abstractmethod
|
|
184
|
+
def fetch_alerts(self, parameters: dict):
|
|
185
|
+
"""
|
|
186
|
+
This method takes in the query parameters needed to filter
|
|
187
|
+
alerts for a broker and makes the GET query to the broker
|
|
188
|
+
endpoint.
|
|
189
|
+
|
|
190
|
+
:param parameters: JSON string of query parameters
|
|
191
|
+
:type parameters: dict
|
|
192
|
+
"""
|
|
193
|
+
|
|
194
|
+
def fetch_alert(self, alert_id):
|
|
195
|
+
"""
|
|
196
|
+
This method takes an alert id and retrieves the specific
|
|
197
|
+
alert data from the given broker.
|
|
198
|
+
|
|
199
|
+
:param alert_id: Broker-specific id corresponding with the desired alert
|
|
200
|
+
:type alert_id: str
|
|
201
|
+
"""
|
|
202
|
+
return None
|
|
203
|
+
|
|
204
|
+
def process_reduced_data(self, target, alert=None):
|
|
205
|
+
"""
|
|
206
|
+
Retrieves and creates records for any reduced data provided
|
|
207
|
+
by a specific broker. Updates existing data if it has changed.
|
|
208
|
+
|
|
209
|
+
:param target: ``Target`` object that was previously created from a ``BrokerQuery`` alert
|
|
210
|
+
:type target: Target
|
|
211
|
+
|
|
212
|
+
:param alert: alert data from a particular ``BrokerQuery``
|
|
213
|
+
:type alert: str
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
def to_target(self, alert):
|
|
217
|
+
"""
|
|
218
|
+
Creates ``Target`` object from the broker-specific alert data.
|
|
219
|
+
|
|
220
|
+
:param alert: alert data from a particular ``BrokerQuery``
|
|
221
|
+
:type alert: str
|
|
222
|
+
"""
|
|
223
|
+
return None
|
|
224
|
+
|
|
225
|
+
def submit_upstream_alert(self, target=None, observation_record=None, **kwargs):
|
|
226
|
+
"""
|
|
227
|
+
Submits an alert upstream back to the broker. At least one of a target or an
|
|
228
|
+
observation record must be provided.
|
|
229
|
+
|
|
230
|
+
:param target: ``Target`` object to be converted to an alert and submitted upstream
|
|
231
|
+
:type target: ``Target``
|
|
232
|
+
|
|
233
|
+
:param observation_record: ``ObservationRecord`` object to be converted to an alert and submitted upstream
|
|
234
|
+
:type observation_record: ``ObservationRecord``
|
|
235
|
+
|
|
236
|
+
:returns: True or False depending on success of message submission
|
|
237
|
+
:rtype: bool
|
|
238
|
+
"""
|
|
239
|
+
|
|
240
|
+
@abstractmethod
|
|
241
|
+
def to_generic_alert(self, alert):
|
|
242
|
+
"""
|
|
243
|
+
This method creates a ``GenericAlert`` object from the broker-specific
|
|
244
|
+
alert data for use outside the implementation of the ``GenericBroker``.
|
|
245
|
+
|
|
246
|
+
:param alert: alert data from a particular ``BrokerQuery``
|
|
247
|
+
:type alert: str
|
|
248
|
+
"""
|
|
249
|
+
return None
|
|
250
|
+
|
|
251
|
+
def fetch_and_save_all(self, parameters):
|
|
252
|
+
"""
|
|
253
|
+
Gets all alerts using a particular ``BrokerQuery`` and creates a ``Target`` from each one.
|
|
254
|
+
|
|
255
|
+
:param parameters: JSON string of query parameters
|
|
256
|
+
:type parameters: str
|
|
257
|
+
|
|
258
|
+
:returns: list of ``Target`` objects
|
|
259
|
+
:rtype: list
|
|
260
|
+
"""
|
|
261
|
+
targets = []
|
|
262
|
+
for alert in self.fetch_alerts(parameters):
|
|
263
|
+
generic_alert = self.to_generic_alert(alert)
|
|
264
|
+
full_alert = self.fetch_alert(generic_alert.id)
|
|
265
|
+
target = self.to_target(full_alert)
|
|
266
|
+
targets.append(target)
|
|
267
|
+
|
|
268
|
+
return targets
|
|
269
|
+
|
|
270
|
+
def get_broker_context_data(self, *args, **kwargs):
|
|
271
|
+
"""Override this method in the subclass to allow the Broker to add additional context
|
|
272
|
+
data to the View. This method will be called by views.RunQueryView.get_context_data()
|
|
273
|
+
and the returned dictionary will be added to the View's context.
|
|
274
|
+
"""
|
|
275
|
+
return {}
|
tom_alerts/apps.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from django.apps import AppConfig
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class TomAlertsConfig(AppConfig):
|
|
5
|
+
name = 'tom_alerts'
|
|
6
|
+
|
|
7
|
+
def nav_items(self):
|
|
8
|
+
"""
|
|
9
|
+
Integration point for adding items to the navbar.
|
|
10
|
+
This method should return a list of partial templates to be included in the navbar.
|
|
11
|
+
"""
|
|
12
|
+
return [{'partial': 'tom_alerts/partials/navbar_link.html'}]
|
|
File without changes
|