-
Notifications
You must be signed in to change notification settings - Fork 1
125 better documentation #126
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b86a79c
docs: improve code and user documentation
ziriuz84 272e293
fix(interface): replace eval with get_integer in config_menu
ziriuz84 833be34
fix(scheduling): remove debug print and translate Italian comments
ziriuz84 4cbba90
feat(configuration): implement get_observatory_coordinates
ziriuz84 b423698
docs(interface): improve docstrings
ziriuz84 fbe4187
test(configuration): add print_obs_config redaction tests
ziriuz84 2796555
docs(README): improve structure and content
ziriuz84 6a49d79
chore(release): 1.0.0
ziriuz84 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # AGENTS.md | ||
|
|
||
| Purpose: guidance for agentic edits in asteroidpy. | ||
|
|
||
| **Build / Lint / Test Commands** | ||
| - `python -m build` to build artifacts. | ||
| - `pytest -q` to run the test suite. | ||
| - `pytest <path>::<test_name> -q` for a single test. | ||
| - `ruff check .` (or `flake8`) for linting; `mypy` for type checks. | ||
|
|
||
| **Code Style** | ||
| - **Imports**: standard library first, then third‑party, then local; explicit imports only. | ||
| - **Formatting**: format with Black; sort imports with isort; auto‑format on save if available. | ||
| - **Types & Naming**: use type hints; snake_case for functions/vars; CamelCase for classes. | ||
| - **Errors**: avoid bare excepts; raise/propagate clear exceptions; validate inputs early. | ||
| - **Tests**: tests should be small, isolated; prefer parameterized tests when sensible. | ||
|
|
||
| **Cursor / Copilot Rules** | ||
| - Cursor rules: none found in this repo. | ||
| - Copilot instructions: none found in this repo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,65 @@ | ||
| ## Changelog | ||
|
|
||
| ### [Unreleased] | ||
| - i18n: Load translations from `locales/` using config `General.lang`; reinitialize on change | ||
| - UI: Language menu lists installed locales with native names | ||
| - Locales: Added it, en, de, fr, es, pt and compiled `.mo` | ||
| - Weather: Handle unknown forecast codes gracefully (avoid KeyError) | ||
| - Weather: Narrow exception handling when formatting forecast time (catch only TypeError/ValueError to avoid masking bugs) | ||
| - Configuration: Avoid creating the user's home directory; write to `~/.asteroidpy` directly | ||
| - Configuration: Use `~/.asteroidpy` for config and correct defaults; align tests | ||
| - Configuration: Gracefully handle unreadable or invalid `~/.asteroidpy` by falling back to initialize | ||
| - tests: Add coverage for unreadable config file permissions scenario | ||
| - tests: Add coverage for corrupted/invalid config content fallback in `load_config` (closes #88) | ||
| - i18n: Clarify that checking only `base.po/.mo` may not guarantee translation availability | ||
| - Weather/UI: Improve default wind direction display (avoid ambiguous '?') | ||
| - Docs/Security: Add `SECURITY.md` policy | ||
| - Fix: Make `skycoord_format` robust to invalid strings and accept colon-separated input; return original string on invalid tokens (closes #90) | ||
| - Fix: Accept case-insensitive `coordid` in `skycoord_format` (allow 'RA'/'Dec') | ||
| - Fix: Apply `min_altitude` filtering in `neocp_confirmation` and expose it via the menu (closes #86) | ||
| - tests: Add positive-path test for NEOCP confirmation including a valid object passing all filters | ||
| - Fix: Make `observing_target_list_scraper` robust when the MPC page has fewer than four tables or unexpected/missing headers; return an empty list when no suitable table is found (closes #85) | ||
| - Fix: Make `observing_target_list` skip malformed rows and unparseable times defensively | ||
| - tests: Add coverage for no-table, wrong-headers, and malformed-row cases in observing target list scraping | ||
| - Fix: Add robust error handling to `httpx_get`/`httpx_post`; return safe defaults on exceptions and preserve non-200 status codes; gracefully handle JSON parse failures | ||
| - tests: Add coverage for non-200 responses and request exceptions in `httpx_get`/`httpx_post` (closes #84) | ||
| - Fix: Make `is_visible` inclusive at boundary azimuths (45/135/225/315) and correct north-sector wrap-around; compare in degrees and allow altitude ≥ threshold (closes #83) | ||
| - tests: Add edge-case tests for boundary azimuths and equal-to-threshold altitudes in `is_visible` | ||
| - tests: Add coverage for `object_ephemeris` invalid stepping code; default to 1-hour on unknown code (closes #87) | ||
|
|
||
| ### 2025-08-11 | ||
| - types: Add and refine type hints across package and configure mypy | ||
| - chore(mypy): Extend type checking to tests and docs config | ||
| - tests: Add isolated test suite for configuration and scheduling | ||
| - docs: Better formatting in setup.py | ||
|
|
||
| ### 2022-05 to 2022-10 (historical) | ||
| - docs: Documentation added and finalized for multiple modules | ||
| - feature: Object ephemeris, twilight times, sun/moon ephemeris | ||
| - feature: Virtual horizon configuration and visibility checks | ||
| - refactor: Observing target list and menus; convert to QTable | ||
| - chore: Dependency updates and various maintenance commits | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| ## [1.0.0](https://github.com/ziriuz84/asteroidpy/releases/tag/v1.0.0) (2026-02-14) | ||
|
|
||
| ### Features | ||
|
|
||
| - **configuration:** implement get_observatory_coordinates ([4cbba90](https://github.com/ziriuz84/asteroidpy/commit/4cbba90d0b52f8c9b1085598bcdc03035b931eea)) | ||
| - **scheduling:** add velocity and direction to NEO confirmation ([4e08187](https://github.com/ziriuz84/asteroidpy/commit/4e081871be4a2919b1a6641754f3758c3bf831cf)) | ||
| - **i18n:** load translations from locales and add multi-language menu ([a75d4a4](https://github.com/ziriuz84/asteroidpy/commit/a75d4a44fae7c2b5c13541e66f2200f9f9f64956)) | ||
| - **types:** add and refine type hints across package and configure mypy ([d2c2943](https://github.com/ziriuz84/asteroidpy/commit/d2c2943a2a405e6e8e07e1db30fc681882f679b8)) | ||
|
|
||
| ### Bug Fixes | ||
|
|
||
| - **scheduling:** remove debug print and translate Italian comments ([833be34](https://github.com/ziriuz84/asteroidpy/commit/833be3430ce8be2ed26d02ab97823bf100236d28)) | ||
| - **interface:** replace eval with get_integer in config_menu ([272e293](https://github.com/ziriuz84/asteroidpy/commit/272e293d5a0f449d61c504cdc75fd977f66485aa)) | ||
| - **pyproject.toml:** correct license syntax from colon to equals sign for proper TOML format ([22e186a](https://github.com/ziriuz84/asteroidpy/commit/22e186ab91365ae5a2bbaf310b1b54ef2594afdc)) | ||
| - **pyproject.toml:** change license format from string to dictionary to comply with PEP 621 standards ([d55ab48](https://github.com/ziriuz84/asteroidpy/commit/d55ab488f42584b049836ceacbf094c703f228b7)) | ||
| - **scheduling:** add robust error handling to httpx_get/post and tests for non-200 responses and exceptions ([9a70541](https://github.com/ziriuz84/asteroidpy/commit/9a70541061bd7071f7595c388eb06a216c8f8896)) | ||
| - **scheduling:** make target list scraping robust to missing/malformed HTML tables and rows ([48da712](https://github.com/ziriuz84/asteroidpy/commit/48da712410ca69e174d07dfe4b6d1d7d8d2b81da)) | ||
| - **scheduling:** apply altitude filter and add positive NEOCP test ([10275cc](https://github.com/ziriuz84/asteroidpy/commit/10275cc671934324885bd2dc224f64ab1bc630b4)) | ||
| - **configuration:** handle unreadable or invalid config file in load_config ([0022a1d](https://github.com/ziriuz84/asteroidpy/commit/0022a1d03de6b6f6d6c038ffa3669dd200127425)) | ||
| - **scheduling:** accept case-insensitive coordid in skycoord_format ([5188fb0](https://github.com/ziriuz84/asteroidpy/commit/5188fb0a885ba8a5b2f7533a6f88b82e941fa87d)) | ||
| - **scheduling:** make skycoord_format robust to invalid strings and accept colon-separated input ([8fa3e3d](https://github.com/ziriuz84/asteroidpy/commit/8fa3e3da39fcae2bb800b6d8154b94d683dfac13)) | ||
| - **configuration:** stop creating user's home directory ([889a718](https://github.com/ziriuz84/asteroidpy/commit/889a718b3dfd8fe64c7cc98ecbd63675a0894fc2)) | ||
| - **configuration:** use ~/.asteroidpy for config and correct defaults; fix tests ([abb4e51](https://github.com/ziriuz84/asteroidpy/commit/abb4e51a7da9305ddaba915316a1dd6affc93b6c)) | ||
| - **scheduling:** narrow exception handling in weather time formatting ([a59bb84](https://github.com/ziriuz84/asteroidpy/commit/a59bb84abcecea5ad28dfa640dc3d6a7f1815ee5)) | ||
| - **scheduling:** The use of a try/except block in map_or_na may be unnecessary. ([8618439](https://github.com/ziriuz84/asteroidpy/commit/861843943cc90c99245b2362bc1ef1d9c454566e)) | ||
|
|
||
| ### Code Refactoring | ||
|
|
||
| - **tests:** inline simple conditional in fake_expanduser for clarity ([08df765](https://github.com/ziriuz84/asteroidpy/commit/08df765a118d3a3e55b0547ddea6a81ad8f29598)) | ||
|
|
||
| ### Documentation | ||
|
|
||
| - **README:** improve structure and content ([2796555](https://github.com/ziriuz84/asteroidpy/commit/2796555d15d55971f585981c32cd44961e94de49)) | ||
| - **interface:** improve docstrings ([b423698](https://github.com/ziriuz84/asteroidpy/commit/b423698c6fd7ddef59eb049277d71d783c0e767f)) | ||
| - improve code and user documentation ([b86a79c](https://github.com/ziriuz84/asteroidpy/commit/b86a79ca034138edf927b65f8684ca713f552501)) | ||
| - **changelog:** document is_visible boundary fixes and new tests ([28673a4](https://github.com/ziriuz84/asteroidpy/commit/28673a4c215dfc014437d902f2a40d57fe9173f9)) | ||
| - **changelog:** note robust httpx error handling and new tests (closes #84) ([ce7c8a4](https://github.com/ziriuz84/asteroidpy/commit/ce7c8a423dd968105924baff08b19d5584294138)) | ||
| - **changelog:** document robust parsing for observing target list and new tests (closes #85) ([5284843](https://github.com/ziriuz84/asteroidpy/commit/528484336f609cec66c59c023010dddb5e5e5900)) | ||
| - **changelog:** note min_altitude filter and new NEOCP test ([7c26619](https://github.com/ziriuz84/asteroidpy/commit/7c26619d42f415155ac2c928163fa1797c5fb1a2)) | ||
| - **changelog:** note corrupted/invalid config test for load_config ([82a6482](https://github.com/ziriuz84/asteroidpy/commit/82a6482faa29b488f908b30bcec1f28177a3f1c1)) | ||
| - **changelog:** note fallback on unreadable config and new tests ([6e35a65](https://github.com/ziriuz84/asteroidpy/commit/6e35a65bbf031f2bd532accaecc79fc570ea30e5)) | ||
| - **changelog:** note case-insensitive coordid handling in skycoord_format ([fe6ec20](https://github.com/ziriuz84/asteroidpy/commit/fe6ec202b75c5b37476e8a559ac30db032aed76c)) | ||
| - **changelog:** note skycoord_format robustness improvement and reference #90 ([abfd2cd](https://github.com/ziriuz84/asteroidpy/commit/abfd2cdf52911bbdb862c6ea18e19f5690cd1811)) | ||
| - **changelog:** add missing entries for recent changes ([49bc446](https://github.com/ziriuz84/asteroidpy/commit/49bc446ae968a0c92d9f8001e0c097abacc9c649)) | ||
| - **changelog:** note narrowed exception handling in weather() ([be03194](https://github.com/ziriuz84/asteroidpy/commit/be031947e35623fb1ecc6ee4cb32e98c39f73682)) | ||
| - **changelog:** add CHANGELOG summarizing recent changes ([28fbfe0](https://github.com/ziriuz84/asteroidpy/commit/28fbfe046ba7bcd7fe3b89cae41596038ed91a3b)) | ||
|
|
||
| ### Tests | ||
|
|
||
| - **configuration:** add print_obs_config redaction tests ([fbe4187](https://github.com/ziriuz84/asteroidpy/commit/fbe41879cf3b376271cbdb273aa69276fd08cbcf)) | ||
| - **configuration:** add coverage for corrupted/invalid config file ([694519b](https://github.com/ziriuz84/asteroidpy/commit/694519b949805e8ca92d09f4d883a9f6505d4f72)) | ||
| - **configuration,scheduling:** add isolated test suite ([4a755ab](https://github.com/ziriuz84/asteroidpy/commit/4a755abdcea898c8a4813bd8a84d9abbf64ff997)) | ||
|
|
||
| ### Chores | ||
|
|
||
| - **pyproject.toml:** comment out the GPL v3 license classifier to avoid confusion ([c984bf4](https://github.com/ziriuz84/asteroidpy/commit/c984bf4d75f66d9755666fc869af9cd2e2b0e90d)) | ||
| - **pyproject.toml:** update license format from table to string for consistency and clarity ([d1e6f1d](https://github.com/ziriuz84/asteroidpy/commit/d1e6f1dae36a64a0716bb8bb5545b35e3c338e7c)) | ||
| - **pyproject.toml:** remove unnecessary 'i' character from the file to clean up the configuration ([f4bc4a6](https://github.com/ziriuz84/asteroidpy/commit/f4bc4a66bce272048a3491db4e88203d6e3e87aa)) | ||
| - better setup tools ([7ec4157](https://github.com/ziriuz84/asteroidpy/commit/7ec4157e043cca94f97ea1224535d89fcf884f9a)) | ||
| - **mypy:** extend type checking to tests and docs config ([520179b](https://github.com/ziriuz84/asteroidpy/commit/520179b805d14475dd70e3154f98ad42b7ca86d1)) | ||
| - **setup.py:** better formatting ([5a6a542](https://github.com/ziriuz84/asteroidpy/commit/5a6a542da0c64c86af108e633395e7f9aab02837)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.