Conversation
This commit enhances documentation across the codebase:
- Add AGENTS.md with guidelines for AI-assisted development
* Build, lint, and test commands
* Code style conventions
* Import organization and formatting rules
- Enhance module and function docstrings in Python modules:
* Add comprehensive module-level docstring to __init__.py
* Expand function docstrings with detailed Parameters, Returns, and Notes
* Improve type hints and documentation in configuration.py, interface.py,
and scheduling.py
- Improve Sphinx documentation:
* Add introduction, features list, and quick start guide to index.rst
* Update conf.py with better configuration
* Enhance API reference documentation in asteroidpy.rst
All docstrings now follow NumPy-style documentation format with clear
descriptions of parameters, return values, and usage notes.
Replace eval() on user input with get_integer() to avoid code injection. Remove the docstring Warning section that documented this risk. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove print(r.headers) from httpx_post. Replace Italian comments in get_neocp_ephemeris with cleaner code. Fix docstring: Form data → Query parameters for observing_target_list_scraper. Co-authored-by: Cursor <cursoragent@cursor.com>
Add implementation using MPC.get_observatory_location(). Derive latitude from parallax constants; return 0 for altitude (MPC does not provide elevation). Update docstrings for load_config, virtual_horizon_configuration, and get_observatory_coordinates. Co-authored-by: Cursor <cursoragent@cursor.com>
Add Parameters and Returns to setup_gettext. Clarify select_specific_time returns naive datetime. Improve print_change_horizon_menu and change_horizon documentation. Co-authored-by: Cursor <cursoragent@cursor.com>
Split tests to cover both behaviors: - test_print_obs_config_redacts_sensitive_by_default - test_print_obs_config_shows_values_when_show_sensitive_true Co-authored-by: Cursor <cursoragent@cursor.com>
- Add Configuration and Internationalization sections - Update Requirements (Python 3.8+, pip) - Improve installation with venv instructions - Rename Library used → Dependencies, Data provenience → Data sources - Fix typos, add release history link to CHANGELOG - Fix Contributing section grammar Co-authored-by: Cursor <cursoragent@cursor.com>
Reviewer's GuideThis pull request focuses on improving internal and user-facing documentation across the project, enriching docstrings for core interface, scheduling, and configuration functions, tightening Sphinx configuration for typed docs, expanding and restructuring the README and CHANGELOG, and slightly refining behavior and tests around configuration privacy and menu input safety. Sequence diagram for safer configuration menu input handlingsequenceDiagram
actor User
participant MainMenu as main_menu
participant ConfigMenu as config_menu
participant GetInt as get_integer
participant GeneralMenu as general_config_menu
participant ObsMenu as observatory_config_menu
User->>MainMenu: start application
MainMenu->>ConfigMenu: select Configuration
loop until choice == 0
ConfigMenu->>GetInt: prompt "choice -> "
GetInt-->>ConfigMenu: validated integer choice
alt choice == 1
ConfigMenu->>GeneralMenu: open general configuration
GeneralMenu-->>ConfigMenu: return
else choice == 2
ConfigMenu->>ObsMenu: open observatory configuration
ObsMenu-->>ConfigMenu: return
else choice == 0
ConfigMenu-->>MainMenu: back to main menu
else invalid choice
ConfigMenu-->>User: show invalid choice message
end
end
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `asteroidpy/scheduling.py:763-772` </location>
<code_context>
async def get_neocp_ephemeris(
config: ConfigParser, object_names: List[str]
-) -> Tuple[Union[Dict[str, Any], List[Dict[str, Any]], str], int]:
</code_context>
<issue_to_address>
**issue (performance):** Synchronous `requests` call inside an `async` function can block the event loop
Since this runs in an async context, the synchronous `requests.request` will block the event loop while waiting for the HTTP response. Please either switch to your existing async `httpx_get`/`httpx_post` helpers and `await` the call, or move the blocking call into a thread pool executor to avoid stalling other coroutines.
</issue_to_address>
### Comment 2
<location> `README.md:72` </location>
<code_context>
-- [7Timer](https://7timer.info)
-- [Minor Planet Center](https://www.minorplanetcenter.net/)
+- requests
+- BeautifulSoup4
+- astropy
+- astroplan
</code_context>
<issue_to_address>
**suggestion:** Use the canonical name for Beautiful Soup / beautifulsoup4 in the dependencies list.
Here it’s listed as “BeautifulSoup4”. Please use the canonical PyPI package name `beautifulsoup4` (or the official project name "Beautiful Soup 4") to match what users install.
```suggestion
- beautifulsoup4
```
</issue_to_address>
### Comment 3
<location> `docs/source/index.rst:11-12` </location>
<code_context>
+AsteroidPy is a Python tool designed to help astronomers schedule and manage
+asteroid observations and measurements. It integrates with major sources in
+minor planet research to provide accurate ephemeris predictions and NEOcp
+(Near Earth Object Confirmation Page) candidate listings.
+
+Features
</code_context>
<issue_to_address>
**suggestion (typo):** Hyphenate “Near-Earth Object” in the NEOcp expansion.
Consider updating this phrase to "Near-Earth Object Confirmation Page" to match standard terminology.
```suggestion
minor planet research to provide accurate ephemeris predictions and NEOcp
(Near-Earth Object Confirmation Page) candidate listings.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| async def get_neocp_ephemeris( | ||
| config: ConfigParser, object_names: List[str] | ||
| ) -> Tuple[Union[Dict[str, Any], List[Dict[str, Any]], str], int]: | ||
| ) -> Dict[str, List[str]]: | ||
| """Retrieve ephemeris data for NEOcp objects from the Minor Planet Center. | ||
|
|
||
| Queries the MPC confirmation ephemeris service for multiple objects and | ||
| parses the HTML response to extract ephemeris data including velocity | ||
| and direction information. | ||
|
|
||
| Parameters |
There was a problem hiding this comment.
issue (performance): Synchronous requests call inside an async function can block the event loop
Since this runs in an async context, the synchronous requests.request will block the event loop while waiting for the HTTP response. Please either switch to your existing async httpx_get/httpx_post helpers and await the call, or move the blocking call into a thread pool executor to avoid stalling other coroutines.
| - [7Timer](https://7timer.info) | ||
| - [Minor Planet Center](https://www.minorplanetcenter.net/) | ||
| - requests | ||
| - BeautifulSoup4 |
There was a problem hiding this comment.
suggestion: Use the canonical name for Beautiful Soup / beautifulsoup4 in the dependencies list.
Here it’s listed as “BeautifulSoup4”. Please use the canonical PyPI package name beautifulsoup4 (or the official project name "Beautiful Soup 4") to match what users install.
| - BeautifulSoup4 | |
| - beautifulsoup4 |
| minor planet research to provide accurate ephemeris predictions and NEOcp | ||
| (Near Earth Object Confirmation Page) candidate listings. |
There was a problem hiding this comment.
suggestion (typo): Hyphenate “Near-Earth Object” in the NEOcp expansion.
Consider updating this phrase to "Near-Earth Object Confirmation Page" to match standard terminology.
| minor planet research to provide accurate ephemeris predictions and NEOcp | |
| (Near Earth Object Confirmation Page) candidate listings. | |
| minor planet research to provide accurate ephemeris predictions and NEOcp | |
| (Near-Earth Object Confirmation Page) candidate listings. |
Summary by Sourcery
Improve user- and developer-facing documentation across the project and refine configuration, interface, and scheduling utilities for a 1.0.0 release.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: