Skip to content

Conversation

@lincrosenbach
Copy link
Contributor

@lincrosenbach lincrosenbach commented Jan 14, 2026

>>> from barril.units import Array
>>> import numpy as np
>>> Array(np.array([]), 'm') * 2
Array(length, [], m)
>>> Array([], 'm') * 2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/Work/miniconda/envs.25/alfatwin_stack-py310/lib/python3.10/site-packages/barril/units/_array.py", line 360, in __mul__
    return self._DoOperation(self, other, "Multiply")
  File "~/Work/miniconda/envs.25/alfatwin_stack-py310/lib/python3.10/site-packages/barril/units/_array.py", line 429, in _DoOperation
    return self.__class__.CreateWithQuantity(q, result)  # type:ignore[return-value]
UnboundLocalError: local variable 'q' referenced before assignment

@lincrosenbach lincrosenbach force-pushed the fb-DTWIN-3749-multiply-empty-array branch from 41fc0d6 to 7ce3520 Compare January 14, 2026 11:33
@nicoddemus
Copy link
Member

This change also warrants a changelog entry, I believe.

@lincrosenbach lincrosenbach force-pushed the fb-DTWIN-3749-multiply-empty-array branch 2 times, most recently from 1f89562 to d2ba9b4 Compare January 14, 2026 13:09
@lincrosenbach lincrosenbach force-pushed the fb-DTWIN-3749-multiply-empty-array branch from d2ba9b4 to 6c71166 Compare January 15, 2026 17:01
@sonarqubecloud
Copy link

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks, and sorry for all the nitpicking!

@lincrosenbach lincrosenbach merged commit 594dd83 into master Jan 16, 2026
16 checks passed
2.2.1
-------------------

*2026-01-14*
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, missed this during review, but FYI:

When creating new changelog entries, use UNRELEASED for the date like this:

Suggested change
*2026-01-14*
*UNRELEASED*

This way it is clear this release was not done yet when looking at master, and this is naturally updated to the actual release date as part of the release process.

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.

4 participants