Skip to content

Commit

Permalink
Merge branch 'main' into issue_7704
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian authored Nov 6, 2024
2 parents f414160 + 3a4ff9b commit d841f2f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4799,9 +4799,7 @@ def expand_dims(
if d in self.dims:
raise ValueError(f"Dimension {d} already exists.")
if d in self._variables and not utils.is_scalar(self._variables[d]):
raise ValueError(
f"{d} already exists as coordinate or" " variable name."
)
raise ValueError(f"{d} already exists as coordinate or variable name.")

variables: dict[Hashable, Variable] = {}
indexes: dict[Hashable, Index] = dict(self._indexes)
Expand All @@ -4828,7 +4826,7 @@ def expand_dims(
pass # Do nothing if the dimensions value is just an int
else:
raise TypeError(
f"The value of new dimension {k} must be " "an iterable or an int"
f"The value of new dimension {k} must be an iterable or an int"
)

for k, v in self._variables.items():
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ def _oindex_set(self, indexer: OuterIndexer, value: Any) -> None:
num_non_slices = sum(0 if isinstance(k, slice) else 1 for k in indexer.tuple)
if num_non_slices > 1:
raise NotImplementedError(
"xarray can't set arrays with multiple " "array indices to dask yet."
"xarray can't set arrays with multiple array indices to dask yet."
)
self.array[indexer.tuple] = value

Expand Down
2 changes: 1 addition & 1 deletion xarray/plot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ def _infer_interval_breaks(coord, axis=0, scale=None, check_monotonic=False):
if (coord <= 0).any():
raise ValueError(
"Found negative or zero value in coordinates. "
+ "Coordinates must be positive on logscale plots."
"Coordinates must be positive on logscale plots."
)
coord = np.log10(coord)

Expand Down

0 comments on commit d841f2f

Please sign in to comment.