-
Notifications
You must be signed in to change notification settings - Fork 0
Add monitored flag #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
cef0ea9
df4a1da
6a25e46
6c57903
0c9ed2f
4918822
a772e11
870d23a
c3ed87b
438e4ee
42c66c0
8b4c514
297d1c2
2dd6ae7
2c6fb48
1a36caf
888f487
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| """Add monitored field to fixed_sources and solarsystem_objects | ||
|
|
||
| Revision ID: a1b2c3d4e5f6 | ||
| Revises: 35a6a33e0a34 | ||
| Create Date: 2026-06-01 00:00:00.000000 | ||
|
|
||
| """ | ||
|
|
||
| from collections.abc import Sequence | ||
|
|
||
| import sqlalchemy as sa | ||
|
|
||
| from alembic import op | ||
|
Check failure on line 13 in socat/alembic/versions/a1b2c3d4e5f6_add_monitored_field.py
|
||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision: str = "a1b2c3d4e5f6" | ||
| down_revision: str | None = "35a6a33e0a34" | ||
| branch_labels: str | Sequence[str] | None = None | ||
| depends_on: str | Sequence[str] | None = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| op.add_column( | ||
| "fixed_sources", | ||
| sa.Column("monitored", sa.Boolean, nullable=False, server_default=sa.false()), | ||
| ) | ||
| op.execute("UPDATE fixed_sources SET monitored = false WHERE monitored IS NULL") | ||
| op.add_column( | ||
| "solarsystem_objects", | ||
| sa.Column("monitored", sa.Boolean, nullable=False, server_default=sa.false()), | ||
| ) | ||
| op.execute( | ||
| "UPDATE solarsystem_objects SET monitored = false WHERE monitored IS NULL" | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| op.drop_column("fixed_sources", "monitored") | ||
| op.drop_column("solarsystem_objects", "monitored") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,12 @@ | |
| class ClientBase(ABC): | ||
| @abstractmethod | ||
| def create_source( | ||
| self, *, position: ICRS, name: str | None = None, flux: Quantity | None = None | ||
| self, | ||
| *, | ||
| position: ICRS, | ||
| name: str | None = None, | ||
| flux: Quantity | None = None, | ||
| monitored: bool = False, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So my main thought on this is do we want a specific
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea I could go either way. forced_photometry is a core functionality of this so maybe that exists outside of 'flags' but 'flags' could contain 'pointing source' or 'extended' , etc that we want to use . and people could do custom things if they wanted. |
||
| ) -> RegisteredFixedSource: | ||
| """ | ||
| Create a new source in the catlaog. | ||
|
|
@@ -59,10 +64,11 @@ def get_source(self, *, source_id: int) -> RegisteredFixedSource | None: | |
|
|
||
| @abstractmethod | ||
| def get_forced_photometry_sources( | ||
| self, *, minimum_flux: Quantity | ||
| self, *, minimum_flux: Quantity | None = None | ||
| ) -> list[RegisteredFixedSource]: | ||
| """ | ||
| Get all sources that are used for forced photometry based on a minimum flux. | ||
| Get all sources that are monitored for forced photometry, optionally | ||
| filtered to those above a minimum flux. | ||
| """ | ||
| return [] # pragma: no cover | ||
|
|
||
|
|
@@ -74,6 +80,7 @@ def update_source( | |
| position: ICRS | None = None, | ||
| name: str | None = None, | ||
| flux: Quantity | None = None, | ||
| monitored: bool | None = None, | ||
| ) -> RegisteredFixedSource | None: | ||
| """ | ||
| Update a source. If the source is updated, return its new value. Else, return None. | ||
|
|
@@ -219,7 +226,9 @@ def delete_ephem(self, *, ephem_id: int) -> None: | |
|
|
||
| class SolarSystemClientBase(ABC): | ||
| @abstractmethod | ||
| def create_sso(self, *, name: str, MPC_id: int | None) -> SolarSystemObject: | ||
| def create_sso( | ||
| self, *, name: str, MPC_id: int | None, monitored: bool = False | ||
| ) -> SolarSystemObject: | ||
| """ | ||
| Create a new solar system source in the catalog. | ||
| """ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.