Skip to content

Small refactor from #938#2360

Open
brownbaerchen wants to merge 5 commits into
helmholtz-analytics:mainfrom
brownbaerchen:small_refactor
Open

Small refactor from #938#2360
brownbaerchen wants to merge 5 commits into
helmholtz-analytics:mainfrom
brownbaerchen:small_refactor

Conversation

@brownbaerchen

Copy link
Copy Markdown
Collaborator

These are a few changes from #938 that are not related to advanced indexing, but are simply small refactorings. They shouldn't change the behavior meaningfully.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mtar mtar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't have a consistent style for the type notation in the docstrings. My suggestions are from one style that we have throughout the library, but we can discuss which one we want to use.

Comment thread heat/core/dndarray.py
Comment on lines +80 to +83
self.__balanced: bool = balanced
self.__ishalo = False
self.__halo_next = None
self.__halo_prev = None
self.__halo_next: torch.Tensor | None = None
self.__halo_prev: torch.Tensor | None = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a reason why exactly these fields have a type hint?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I just copied this from #938, I guess because this doesn't have a non None default value..?

Comment thread heat/core/dndarray.py
Comment thread heat/core/dndarray.py Outdated
Comment thread heat/core/dndarray.py Outdated
Comment thread heat/core/dndarray.py Outdated
Comment thread heat/core/dndarray.py Outdated
Comment thread heat/core/dndarray.py Outdated
Comment thread heat/core/dndarray.py Outdated
Comment thread heat/core/dndarray.py Outdated
# fit the clusters
k = 3
kmedian = ht.cluster.KMedians(n_clusters=k)
kmedian = ht.cluster.KMedians(n_clusters=k, random_state=1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do you pass an argument for random_state?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is a random change from #938. I can remove it from here and there, if you want..

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Roadmap Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants