Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlopaciuk committed Apr 22, 2024
1 parent 4f88d51 commit 3b34d49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions xobjects/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def __call__(self, *args, **kwargs):


def assert_allclose(a, b, rtol=1e-7, atol=1e-7):
if hasattr(a, 'get'):
if hasattr(a, "get"):
a = a.get()
if hasattr(b, 'get'):
if hasattr(b, "get"):
b = b.get()
np_assert_allclose(a, b, rtol=rtol, atol=atol)
10 changes: 7 additions & 3 deletions xobjects/hybrid_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ def __set__(self, container, value):
# in the latter case reference mechanism is used)
if not (
container._xobject._buffer is value._xobject._buffer
and (getattr(container._xobject, self.name) is not None and
getattr(container._xobject, self.name)._offset == value._xobject._offset)
and (
getattr(container._xobject, self.name) is not None
and getattr(container._xobject, self.name)._offset
== value._xobject._offset
)
):
setattr(container._xobject, self.name, value._xobject)

Expand Down Expand Up @@ -324,7 +327,8 @@ def _static_from_dict(cls, dct, _context=None, _buffer=None, _offset=None):

@classmethod
def from_dict(cls, dct, _context=None, _buffer=None, _offset=None):
return HybridClass._static_from_dict(cls,
return HybridClass._static_from_dict(
cls,
dct,
_context=_context,
_buffer=_buffer,
Expand Down

0 comments on commit 3b34d49

Please sign in to comment.