Skip to content

Implement local fixed-frame Trajectory#41

Draft
jtodev wants to merge 11 commits intomainfrom
trajectory-fixed-frame
Draft

Implement local fixed-frame Trajectory#41
jtodev wants to merge 11 commits intomainfrom
trajectory-fixed-frame

Conversation

@jtodev
Copy link
Copy Markdown
Member

@jtodev jtodev commented Apr 1, 2026

Summary

Implements the fixed-frame trajectory starting point for scene synthesis, using the Acoular implementation as a guide, and structures it so future motion/reference-frame work can build on it more cleanly.

Changes

  • add abstract scene_synthesis.trajectory.Trajectory
  • add concrete scene_synthesis.trajectory.FixedTrajectory
  • switch Source.trajectory to the local abstract Trajectory type
  • export Trajectory and FixedTrajectory from scene_synthesis
  • update trajectory test cases to use scene_synthesis.FixedTrajectory
  • add support for interval, location(), traj(), and shift_by_offset()
  • add validation for invalid spline inputs
  • add unit tests and doctests for the new trajectory implementation

Issue linkage

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

Output of diff-cover 🔍:shipit:

-------------
Diff Coverage
Diff: origin/main...HEAD, staged and unstaged changes
-------------
src/scene_synthesis/__init__.py (100%)
src/scene_synthesis/sources.py (100%)
src/scene_synthesis/trajectory.py (85.4%): Missing lines 19,23,64-65,169-170,172
-------------
Total:   52 lines
Missing: 7 lines
Coverage: 86%
-------------

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements a local fixed-frame Trajectory abstraction for scene_synthesis, replacing direct usage of acoular.Trajectory and adding initial unit tests to validate core trajectory behaviors.

Changes:

  • Added scene_synthesis.trajectory.Trajectory backed by a SciPy spline fit and exposed it from scene_synthesis.__init__.
  • Switched Source.trajectory typing/imports to use the local Trajectory.
  • Updated trajectory test cases and added new unit tests for interval, location(), and traj().

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_trajectory.py Adds direct unit tests for Trajectory.interval, Trajectory.location, and Trajectory.traj.
tests/cases_trajectory.py Updates trajectory case fixtures to build scene_synthesis.Trajectory instances instead of acoular.Trajectory.
src/scene_synthesis/trajectory.py Introduces the new fixed-frame Trajectory implementation using splprep/splev.
src/scene_synthesis/sources.py Updates Source to depend on the local Trajectory type and refreshes docs/imports accordingly.
src/scene_synthesis/init.py Re-exports Trajectory at the package top-level.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/scene_synthesis/trajectory.py
Comment thread src/scene_synthesis/trajectory.py
Comment thread src/scene_synthesis/trajectory.py Outdated
jtodev and others added 2 commits April 1, 2026 15:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jtodev jtodev requested a review from artpelling April 1, 2026 13:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

tests/cases_trajectory.py:15

  • The class docstring says these are cases for FixedTrajectory objects, but case_none returns [None]. Consider adjusting the docstring to reflect that cases may include None (or remove case_none if only trajectories are intended), to keep the documentation consistent with the actual returned values.
class Trajectories:
    """Test cases for all :class:`scene_synthesis.trajectory.FixedTrajectory` objects.

    New trajectories should be added here.
    """

    def case_none(self):
        """No trajectory test case."""
        return [None]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/scene_synthesis/sources.py
Comment thread src/scene_synthesis/sources.py
Comment thread src/scene_synthesis/trajectory.py
@jtodev jtodev marked this pull request as draft April 8, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trajectory implementation with fixed frame of reference

2 participants