Skip to content

Commit

Permalink
a bit of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
janpipek committed Jan 13, 2025
1 parent 7557f14 commit 4dac3ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/physt/_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Note that the histogram classes are rather data structures and need computed data to be created.
"""

from __future__ import annotations

from typing import TYPE_CHECKING, cast
Expand Down Expand Up @@ -177,9 +178,7 @@ def h3(data: Optional[ArrayLike], bins=None, **kwargs) -> HistogramND:
and not np.isscalar(data[0])
):
if "axis_names" not in kwargs:
kwargs["axis_names"] = [
(column.name if hasattr(column, "name") else None) for column in data
]
kwargs["axis_names"] = [getattr(column, "name", None) for column in data]
data = np.concatenate([item[:, np.newaxis] for item in data], axis=1)
else:
kwargs["dim"] = 3
Expand Down

0 comments on commit 4dac3ed

Please sign in to comment.