Skip to content

Conversation

@rfrenchseti
Copy link
Collaborator

@rfrenchseti rfrenchseti commented Dec 16, 2025

  • Reorganize nav, backplanes, main, experiements, and util into new src directory.
  • Update documentation, GitHub workflows, and test/flake8/mypy configurations.

Summary by CodeRabbit

  • New Features

    • New CLI entry points added: nav_offset, nav_offset_cloud_tasks, nav_create_simulated_image, nav_backplanes, nav_backplanes_cloud_tasks, nav_backplane_viewer.
  • Chores

    • Project restructured to a src/ layout and runtime dependencies added: PyQt6, rms-cloud_tasks, scipy.
    • .gitignore updated with additional ignore patterns.
  • Tests / Tooling

    • Testing and quality-tool configs updated to target the src/ tree and bumped workflow tooling versions.
  • Documentation

    • Docs updated to reflect the new source-tree paths and minor formatting fixes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Walkthrough

Rebases project layout to a src/ package: updates CI, linters, typing config, docs, gitignore, pyproject packaging/dependencies, and moves CLI entry points under src/main/ with sys.path bootstrapping and minor API/entry-point adjustments.

Changes

Cohort / File(s) Summary
Linting & Typing Config
.flake8, .mypy.ini
Update exclude/per-file-ignores to src/..., add src/experiments to mypy/flake8 excludes, and add a mypy section for nav._version.
CI Workflow
.github/workflows/run-tests.yml
Bump actions (checkout v4→v6, setup-python v5→v6); change flake8/mypy targets to src; remove commented workload identity block.
VCS Ignore / Packaging helpers
.gitignore, pyproject.toml
Add **/_version.py and nav_default_config.yaml to .gitignore; pyproject: set package discovery to where=["src"], change write_to to src/nav/_version.py, add deps (PyQt6, rms-cloud_tasks, scipy), pytest pythonpath, and new script entry points.
Sphinx / Docs
docs/conf.py, docs/*.rst (multiple)
docs/conf.py appends ../src to sys.path; many .rst files update textual code/example paths from nav/...src/nav/... and adjust heading underlines/formatting.
CLI Entry Points (source-run bootstrap)
src/main/*:
src/main/nav_backplane_viewer.py, src/main/nav_backplanes.py, src/main/nav_backplanes_cloud_tasks.py, src/main/nav_create_simulated_image.py, src/main/nav_offset.py, src/main/nav_offset_cloud_tasks.py
Prepend computed package source path to sys.path so CLIs run from source tree; adjust imports (e.g., nav.backplanes.backplanesbackplanes.backplanes), rename async entry to async_main() and add synchronous main() wrapper in cloud-tasks script.
Utilities
src/util/report_profile.py
Add explicit return type annotation def main() -> None.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay extra attention to:
    • script entry-point module paths in pyproject.toml (mixed src.main.* vs main.*);
    • consistency of sys.path bootstrapping across src/main/* scripts and resulting import changes;
    • nav_offset_cloud_tasks.py async→sync wrapper rename and its effect on existing invocations.

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Reorg into src directory' accurately describes the main objective of the pull request—reorganizing the codebase into a new src directory structure.

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 427d3bc and b1c9231.

📒 Files selected for processing (1)
  • .mypy.ini (1 hunks)
🔇 Additional comments (2)
.mypy.ini (2)

4-4: Exclusion path looks reasonable for src-layout reorganization.

The src/experiments exclusion is appropriate given the PR reorganizes the project structure.


6-7: Verify that mypy is configured to resolve the src-layout properly.

For the src-layout reorganization to work correctly with mypy, the tool needs explicit configuration to locate packages under src/. This typically requires:

  • mypy_path setting pointing to src/, or
  • namespace packages configuration

Please confirm that mypy path resolution is configured elsewhere (e.g., in pyproject.toml or via environment variables). Additionally, verify that nav._version is a generated or vendored module that legitimately requires lenient import handling.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f71107c and f387077.

📒 Files selected for processing (22)
  • .flake8 (1 hunks)
  • .github/workflows/run-tests.yml (3 hunks)
  • .gitignore (1 hunks)
  • .mypy.ini (1 hunks)
  • docs/conf.py (1 hunks)
  • docs/developer_guide_backplanes.rst (2 hunks)
  • docs/developer_guide_best_practices.rst (1 hunks)
  • docs/developer_guide_building_docs.rst (1 hunks)
  • docs/developer_guide_configuration.rst (1 hunks)
  • docs/developer_guide_extending.rst (4 hunks)
  • docs/developer_guide_introduction.rst (1 hunks)
  • docs/user_guide_backplanes.rst (3 hunks)
  • docs/user_guide_navigation.rst (1 hunks)
  • pyproject.toml (3 hunks)
  • src/main/nav_backplane_viewer.py (2 hunks)
  • src/main/nav_backplanes.py (2 hunks)
  • src/main/nav_backplanes_cloud_tasks.py (1 hunks)
  • src/main/nav_create_simulated_image.py (2 hunks)
  • src/main/nav_offset.py (1 hunks)
  • src/main/nav_offset_cloud_tasks.py (3 hunks)
  • src/nav/_version.py (1 hunks)
  • src/util/report_profile.py (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-11-24T19:48:51.676Z
Learnt from: rfrenchseti
Repo: SETI/rms-nav PR: 48
File: main/nav_main_offset.py:167-171
Timestamp: 2025-11-24T19:48:51.676Z
Learning: In the nav_main_offset.py file, it is normal and expected for the nav_default_config.yaml file to be missing. The FileNotFoundError suppression when attempting to load this default config is intentional behavior, not an error condition that needs logging.

Applied to files:

  • .gitignore
  • docs/user_guide_navigation.rst
📚 Learning: 2025-11-24T02:08:32.443Z
Learnt from: rfrenchseti
Repo: SETI/rms-nav PR: 48
File: nav/config_files/config_90_backplanes.yaml:29-47
Timestamp: 2025-11-24T02:08:32.443Z
Learning: In nav/config_files/config_90_backplanes.yaml, the `phase_angle` method is intentionally shared between body and ring backplanes. While other ring backplane methods use ring-specific names (e.g., `ring_emission_angle`, `ring_angular_resolution`), `phase_angle` works for both bodies and rings without needing a `ring_phase_angle` variant.

Applied to files:

  • docs/developer_guide_backplanes.rst
📚 Learning: 2025-11-10T22:24:08.880Z
Learnt from: rfrenchseti
Repo: SETI/rms-nav PR: 14
File: nav/obs/__init__.py:36-44
Timestamp: 2025-11-10T22:24:08.880Z
Learning: In nav/obs/__init__.py, the __all__ list should maintain semantic grouping rather than alphabetical ordering: generic classes (Obs, ObsSnapshot, ObsSnapshotInst) first, followed by specific instrument classes (ObsCassiniISS, etc.), then helper functions (inst_names, inst_name_to_obs_class).

Applied to files:

  • docs/developer_guide_extending.rst
📚 Learning: 2025-11-10T22:26:37.929Z
Learnt from: rfrenchseti
Repo: SETI/rms-nav PR: 14
File: nav/support/correlate_old.py:83-88
Timestamp: 2025-11-10T22:26:37.929Z
Learning: The file nav/support/correlate_old.py contains legacy code and should be excluded from code reviews.

Applied to files:

  • .flake8
🧬 Code graph analysis (1)
src/main/nav_backplanes.py (2)
src/nav/config/config.py (1)
  • backplanes (218-222)
src/backplanes/backplanes.py (1)
  • generate_backplanes_image_files (19-179)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Test nav (ubuntu-latest, 3.13)
  • GitHub Check: Test nav (ubuntu-latest, 3.10)
  • GitHub Check: Test nav (ubuntu-latest, 3.11)
  • GitHub Check: Test nav (ubuntu-latest, 3.12)
🔇 Additional comments (29)
.gitignore (1)

168-168: LGTM! Entry aligns with the reorganization and expected behavior.

Adding nav_default_config.yaml to .gitignore is appropriate given that this file is expected to be missing or generated locally (as per the FileNotFoundError suppression pattern). This complements the reorganization into src/.

Optional suggestion: Consider adding a brief comment above this entry (e.g., # Navigation default config (generated/environment-specific)) to clarify its purpose, especially if other developers may wonder why this file is ignored.

.mypy.ini (1)

4-4: The experiments directory path and exclusion are correctly configured.

The src/experiments directory exists with the reorganized codebase, and the exclude path is properly formatted for mypy. The configuration aligns with the repo's strict type checking setup (strict = True) while explicitly opting experiments out of type checking, which appears intentional.

docs/developer_guide_configuration.rst (1)

1-9: LGTM! Documentation updated for src/ reorganization.

The path reference has been correctly updated to reflect the new directory structure.

src/main/nav_backplanes_cloud_tasks.py (2)

17-20: LGTM! Standard sys.path bootstrapping pattern.

This allows the CLI to be run directly from the source tree. The E402 flake8 ignore in .flake8 for src/main/*.py files confirms this pattern is intentional.


22-26: Verify import path consistency across CLI scripts.

The import path for backplanes.backplanes was changed while nav.* imports remain prefixed. This suggests backplanes and nav are sibling directories under src/. Ensure all CLI scripts follow the same import pattern.

#!/bin/bash
# Verify import patterns in CLI scripts after sys.path bootstrap

# Check all CLI scripts for import patterns
echo "=== Checking import patterns in src/main/*.py files ==="
for file in src/main/*.py; do
    echo "File: $file"
    # Look for sys.path manipulation
    if grep -q "sys.path.insert" "$file"; then
        echo "  Has sys.path bootstrap: YES"
        # Check imports after the sys.path line
        awk '/sys.path.insert/,0' "$file" | grep -E "^from (nav|backplanes|experiments|util)" | head -5
    else
        echo "  Has sys.path bootstrap: NO"
    fi
    echo ""
done

echo "=== Verify directory structure under src/ ==="
fd -t d -d 1 . src/
docs/developer_guide_introduction.rst (1)

1-3: LGTM! Formatting update.

Title underline adjusted for consistency with other documentation files.

docs/developer_guide_best_practices.rst (1)

1-3: LGTM! Formatting update.

Title underline adjusted for consistency.

src/util/report_profile.py (1)

3-7: LGTM! Added return type annotation.

Good practice to add type hints. The formatting adjustments are minor improvements.

docs/developer_guide_building_docs.rst (1)

1-3: LGTM! Formatting update.

Title underline adjusted for consistency.

.flake8 (1)

4-14: LGTM! Flake8 configuration updated for src/ layout.

All paths correctly updated to reflect the new directory structure. The E402 ignore for src/main/*.py is appropriate for CLI scripts that use sys.path bootstrapping to enable running from the source tree.

Based on learnings, the exclusion of src/nav/support/correlate_old.py (legacy code) is maintained.

src/main/nav_create_simulated_image.py (2)

4-4: LGTM! Import added for sys.path bootstrapping.

The os import is needed for the path manipulation logic added below.


41-44: LGTM! Standard sys.path bootstrapping pattern.

This enables running the CLI directly from the source tree by adding the src/ directory to the module search path. The pattern is consistent with other CLI scripts in this PR.

src/main/nav_backplanes.py (2)

17-20: LGTM: Source tree execution bootstrap.

The sys.path manipulation correctly enables running the CLI directly from the source tree, consistent with other scripts in this PR.


30-30: The import is correct and consistent with the repository's module structure. backplanes is intentionally a top-level package at src/backplanes/, not under the nav namespace. The sys.path manipulation at line 20-21 is documented and designed to make CLI tools executable from the source tree—this is standard practice and not fragile. The architectural separation is by design, not accidental.

Likely an incorrect or invalid review comment.

src/main/nav_backplane_viewer.py (1)

36-39: LGTM: Consistent source tree bootstrap.

The sys.path manipulation correctly enables source-tree execution and is consistent with the pattern used across CLI scripts in this PR.

.github/workflows/run-tests.yml (2)

19-19: LGTM: GitHub Actions version upgrades.

Upgrading to actions/checkout@v6 and actions/setup-python@v6 brings the workflow to the latest stable versions.

Also applies to: 22-22, 55-55, 58-58


32-32: LGTM: Tool targets updated for src/ layout.

The flake8 and mypy targets correctly reflect the reorganized project structure.

Also applies to: 36-36

src/main/nav_offset_cloud_tasks.py (2)

18-21: LGTM: Source tree bootstrap.

The sys.path manipulation is consistent with other CLI scripts and enables source-tree execution.


128-154: LGTM: Well-designed entry point refactoring.

The refactoring separates the async implementation (async_main()) from the synchronous entry point wrapper (main()). This is excellent design that properly supports setuptools console script entry points, which require synchronous functions.

docs/user_guide_navigation.rst (1)

104-104: LGTM: Documentation updated for new layout.

The path correctly reflects the reorganized directory structure.

src/nav/_version.py (1)

31-34: Version metadata update (auto-generated).

This file is auto-generated by setuptools-scm and the version/commit changes are expected. No review needed.

docs/conf.py (1)

10-10: LGTM: Sphinx configuration updated for src/ layout.

The path adjustment ensures Sphinx autodoc can properly import modules from the reorganized structure.

src/main/nav_offset.py (1)

21-24: LGTM: Source tree bootstrap.

The sys.path manipulation is consistent with other CLI scripts and correctly enables source-tree execution.

docs/developer_guide_backplanes.rst (1)

1-79: LGTM! Documentation paths updated consistently.

All path references have been correctly updated from nav/* to src/nav/* to reflect the new source directory structure.

docs/user_guide_backplanes.rst (1)

1-111: LGTM! User guide paths updated consistently.

All path references in examples and configuration descriptions have been correctly updated to reflect the new src/nav/ structure.

docs/developer_guide_extending.rst (1)

1-98: LGTM! Developer guide paths updated consistently.

All path references for extending the system have been correctly updated to the new src/nav/ structure across all sections (Dataset, Instrument, Navigation Model, and Navigation Technique).

pyproject.toml (3)

57-60: LGTM! Pytest configuration is correct.

The pytest pythonpath configuration correctly points to the src directory, which is the standard approach for src-layout projects.


71-71: LGTM! Version file path updated correctly.

The version file path has been correctly updated to reflect the new src/nav/_version.py location.


14-26: All newly added dependencies are actively used and necessary for the project:

  • PyQt6: Used extensively for GUI components across multiple UI modules
  • rms-cloud_tasks: Used in cloud processing scripts for distributed task execution
  • scipy: Used for scientific computing operations (image processing, signal analysis, interpolation)
  • ruamel.yaml: Used for YAML-based configuration file handling

@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 36.98%. Comparing base (f71107c) to head (b1c9231).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #61      +/-   ##
==========================================
+ Coverage   34.63%   36.98%   +2.35%     
==========================================
  Files          63       57       -6     
  Lines        4678     4350     -328     
  Branches      616      564      -52     
==========================================
- Hits         1620     1609      -11     
+ Misses       2958     2641     -317     
  Partials      100      100              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f387077 and 3580e28.

📒 Files selected for processing (1)
  • pyproject.toml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Test nav (ubuntu-latest, 3.12)
  • GitHub Check: Test nav (ubuntu-latest, 3.10)
  • GitHub Check: Test nav (ubuntu-latest, 3.11)
  • GitHub Check: Test nav (ubuntu-latest, 3.13)
🔇 Additional comments (3)
pyproject.toml (3)

57-60: LGTM!

The pytest configuration with pythonpath = ["src"] is correct for the src-layout and ensures tests can properly import packages during test execution.


64-64: LGTM!

The package discovery configuration has been correctly fixed to use where = ["src"] as previously recommended. This properly configures setuptools to find packages inside the src directory.


71-71: LGTM!

The version file path has been correctly updated to src/nav/_version.py to align with the new src-layout.

@rfrenchseti
Copy link
Collaborator Author

@CodeRabbit review

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@rfrenchseti rfrenchseti merged commit 9d5ddfd into main Dec 16, 2025
8 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 16, 2025
@rfrenchseti rfrenchseti deleted the rf251216_reorg branch December 22, 2025 23:15
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.

2 participants