Skip to content

Remove unused pydantic_numpy import from spectrum.py#26

Merged
tomdurrant merged 4 commits intomainfrom
copilot/add-pydantic-numpy-dependency
Feb 24, 2026
Merged

Remove unused pydantic_numpy import from spectrum.py#26
tomdurrant merged 4 commits intomainfrom
copilot/add-pydantic-numpy-dependency

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

pydantic_numpy was imported in spectrum.py but not declared as a dependency. The Frequency and LogFrequency classes using it are not referenced anywhere in the codebase.

Changes

  • Removed pydantic_numpy.typing.Np1DArray import
  • Changed field type from Np1DArray to list[float] (Pydantic-native)
  • Updated Frequency properties to convert list to numpy array on access
  • Removed numpy return type annotation from LogFrequency.__call__
# Before
from pydantic_numpy.typing import Np1DArray

class Frequency(RompyBaseModel):
    freq: Np1DArray = Field(description="Frequency array")
    
    @property
    def f0(self):
        return self.freq.min()

# After
class Frequency(RompyBaseModel):
    freq: list[float] = Field(description="Frequency array")
    
    @property
    def f0(self):
        return np.array(self.freq).min()
Original prompt

This section details on the original issue you should resolve

<issue_title>Package pydantic_numpy missing in dependencies</issue_title>
<issue_description>pydantic-numpy isn't listed as a dependency in pyproject.toml but is imported in core/spectrum.py.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 19, 2026 01:48
Co-authored-by: tomdurrant <11531133+tomdurrant@users.noreply.github.com>
Co-authored-by: tomdurrant <11531133+tomdurrant@users.noreply.github.com>
Co-authored-by: tomdurrant <11531133+tomdurrant@users.noreply.github.com>
Copilot AI changed the title [WIP] Add pydantic_numpy to project dependencies Remove unused pydantic_numpy import from spectrum.py Feb 19, 2026
Copilot AI requested a review from tomdurrant February 19, 2026 01:52
@tomdurrant tomdurrant marked this pull request as ready for review February 24, 2026 06:44
@tomdurrant tomdurrant merged commit e0029fb into main Feb 24, 2026
1 check passed
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.

Package pydantic_numpy missing in dependencies

2 participants