Skip to content

Time box#25

Merged
Sulla2012 merged 18 commits into
mainfrom
time_box
May 13, 2026
Merged

Time box#25
Sulla2012 merged 18 commits into
mainfrom
time_box

Conversation

@Sulla2012
Copy link
Copy Markdown
Collaborator

Update get_box to two functions, one for fixed sources get_box_fixed and the other for ssos get_box_sso. In order to make get_box_sso work with client.mock, I had to make ephem_cat an argument of mock.get_box_sso, since intrinsically with mock one DB does not know about another DB. This does make the parameters of mock.get_box_sso and db.get_box_sso different from core.get_box_sso. This PR also switches every instance of time in the DB from int unix time to astropy.time.Time or datetime, as appropriate.

@Sulla2012 Sulla2012 requested review from JBorrow and axf295 May 7, 2026 13:56
Copy link
Copy Markdown
Member

@JBorrow JBorrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from one thing (which I may have missed). I'd like to have a single unified function on the client that calls both fixed and moving and returns them as two lists.

Comment thread socat/client/core.py Outdated
@abstractmethod
def delete_ephem(self, *, ephem_id: int) -> None:
def update_sso(
self, *, solar_id: int, name: str | None, MPC_id: int | None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is solar_id different from sso_id?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No they should be the same, looks like it's just these functions that use solar_id, I'll change em over.

Copy link
Copy Markdown
Contributor

@axf295 axf295 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great - some places where times were ints ... not sure if those were internal and fine, or missed

Comment thread socat/client/mock.py Outdated
sso_id: int | None,
MPC_id: int | None,
name: str | None,
time: int | None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be time: Time | none ?

Comment thread socat/core/all_sources.py Outdated
async def get_time_box(
lower_left: ICRS,
upper_right: ICRS,
start_time: int,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

times as ints?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were missed, just call out the ones I should change.

@Sulla2012
Copy link
Copy Markdown
Collaborator Author

@JBorrow yeah that feature is on the docket to-do but I wanted to give Allen the tools he needed ahead of time.

@Sulla2012
Copy link
Copy Markdown
Collaborator Author

@JBorrow requested feature is now in core.all_sources.get_box. Note this does not replicate the functionality of the old get_box and so will break scripts using that function (but I think it's just you me and Allen who would have such scripts so it's probably fine).

@JBorrow
Copy link
Copy Markdown
Member

JBorrow commented May 11, 2026

Is it possible to implement this on the clients? So client.get_box returns both...

@Sulla2012
Copy link
Copy Markdown
Collaborator Author

Yeah can do.

@JBorrow
Copy link
Copy Markdown
Member

JBorrow commented May 13, 2026

Love it. @axf295 is this what we're looking for?

Comment thread socat/client/db.py Outdated
Copy link
Copy Markdown
Contributor

@axf295 axf295 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like exactly what I want!

will try to get to testing it tomorrow

@Sulla2012 Sulla2012 merged commit 5eebfb7 into main May 13, 2026
3 checks passed
@Sulla2012 Sulla2012 deleted the time_box branch May 13, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants