Skip to content

Typing NDCube#950

Open
samaloney wants to merge 18 commits into
sunpy:mainfrom
samaloney:feature-typing
Open

Typing NDCube#950
samaloney wants to merge 18 commits into
sunpy:mainfrom
samaloney:feature-typing

Conversation

@samaloney

@samaloney samaloney commented Jul 23, 2026

Copy link
Copy Markdown
Member

PR Description

Add types and type checking to NDCube

  • Some of the types could probably use astropy's QuantityLike
  • Some of the types weren't clear so had to guess
  • Found some real or at least potential bugs (commit e1808f4)

AI Assistance Disclosure

AI tools were used for:

  • [x ] Code generation (e.g., when writing an implementation or fixing a bug)
  • [ ] Test/benchmark generation
  • [ ] Documentation (including examples)
  • [x ] Research and understanding
  • [ ] No AI tools were used

Regardless of AI use, the human contributor remains fully responsible for correctness, design choices, licensing compatibility, and long-term maintainability.

@samaloney

Copy link
Copy Markdown
Member Author

Not sure how to resolve the doc build issue I think its because there is more then one slice object so it can be uniquely resolved?

def __str__(self) -> str:
classname = self.__class__.__name__
elements = [f"{', '.join(table.names)} ({axes}) {table.physical_types}: {table}"
elements = [f"{', '.join(table.names or ())} ({axes}) {table.physical_types}: {table}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
elements = [f"{', '.join(table.names or ())} ({axes}) {table.physical_types}: {table}"
elements = [f"{', '.join(table.names) if table.names else ()} ({axes}) {table.physical_types}: {table}"

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