Skip to content
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

Search for events #237

Open
WinXaito opened this issue Jan 16, 2022 · 4 comments · May be fixed by #287
Open

Search for events #237

WinXaito opened this issue Jan 16, 2022 · 4 comments · May be fixed by #287
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@WinXaito
Copy link

Currently kosmoro allows you to obtain a list of events from dates. The idea would be to be able to do the opposite, get dates from an event.

I think that it is necessary to define default ranges (we are not going to generate dates ad infinitum) and to be able to specify them. I think we should also indicate if we want future/past/both dates.

@WinXaito WinXaito added the enhancement New feature or request label Jan 16, 2022
@Deuchnord
Copy link
Member

This is really a good idea!
It will need the Kosmorro/lib#43 to be implemented first, though.

@Deuchnord Deuchnord added this to the v1.1 milestone Jan 16, 2022
@Deuchnord Deuchnord changed the title Add the possibility to request the dates of an event Add the possibility to search for specific events Feb 2, 2022
@nicfb
Copy link
Contributor

nicfb commented Sep 25, 2022

Hello! I would like to try to add this feature if it hasn’t already been started. I have the base functionality working, but I have a couple of questions.

Here is what I propose:

  1. Add 3 new command line parameters: --search, --start, and --end
    • ex: kosmorro --search apogee conjunction --start 2021-01-20 --end 2021-01-28
  2. Events are retrieved from search_events() if --search is provided, otherwise get_events() is called as normal
  3. Event dates must be formatted differently to include month, day and year when retrieved from search (still working on a clean way to do this)
  4. Should omitting the start/end dates search the next 24 hours? Or should they be required?
  5. Should moon phase hours still be included in search output?
  6. What do you think the maximum allowed date range should be?

image

@Deuchnord
Copy link
Member

Hi! Thanks for your proposal! 😄

Here is what I propose:

1. Add 3 new command line parameters: `--search`, `--start`, and `--end`
   
   * ex: `kosmorro --search apogee conjunction --start 2021-01-20 --end 2021-01-28`

Sound good to me, maybe the date arguments should be named --from and --to? Really cosmetic question :D

2. Events are retrieved from `search_events()` if `--search` is provided, otherwise `get_events()` is called as normal

This function is not released yet (will be available in Kosmorrolib 1.1, which I'd like to release once Kosmorro 1.0 is released). So, you can start making your development after updating the lib to features branch, but your PR won't be merged until then. Is it ok for you?

3. Event dates must be formatted differently to include month, day and year when retrieved from search (still working on a clean way to do this)

The proposed output in your screenshot seems good to me, just remove the seconds and we'll be fine :)

4. Should omitting the start/end dates search the next 24 hours? Or should they be required?

To me, searching for events without providing dates has no real sense, so we can require them.

5. Should moon phase hours still be included in search output?

I think the search mode should be considered as an special execution mode, so everything that is not related (ephemerides, moon phase) should be removed.

6. What do you think the maximum allowed date range should be?

Let's give freedom to the user, no maximum range here. There is no real need for that.
Just make sure to catch the kosmorrolib.exceptions.OutOfRangeDateError to prevent calculation errors from the Skyfield library.

@nicfb
Copy link
Contributor

nicfb commented Oct 2, 2022

Sound good to me, maybe the date arguments should be named --from and --to? Really cosmetic question :D

I agree! I think --from and --to are more readable than what I suggested.

This function is not released yet (will be available in Kosmorrolib 1.1, which I'd like to release once Kosmorro 1.0 is released). So, you can start making your development after updating the lib to features branch, but your PR won't be merged until then. Is it ok for you?

Yes, this sounds good to me.

I am working on implementing this and the other comments above now!

@Deuchnord Deuchnord changed the title Add the possibility to search for specific events Search for events Oct 2, 2022
@nicfb nicfb linked a pull request Oct 9, 2022 that will close this issue
1 task
@Deuchnord Deuchnord linked a pull request Dec 21, 2023 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants