Skip to content

Commit

Permalink
simply cast to int
Browse files Browse the repository at this point in the history
  • Loading branch information
giboul committed Dec 6, 2024
1 parent f2899d1 commit d2cd7a2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/pyclaw/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ def get_clawpack_dot_xxx(modname): return modname.rpartition('.')[0]
if len(arg) == 1:
# Load frame
frame = arg[0]
if not isinstance(frame,numbers.Integral):
raise Exception(
'Invalid pyclaw.Solution object initialization: '
+ repr(frame) + ' is not an int.'
)
frame = int(frame)
if ('count_from_zero' in kargs):
if (kargs['count_from_zero'] == True):
self._start_frame = 0
Expand Down Expand Up @@ -182,7 +178,7 @@ def get_clawpack_dot_xxx(modname): return modname.rpartition('.')[0]
raise Exception("Invalid arguments for Solution initialization.")
elif len(arg) == 0:
if 'frame' in kargs:
frame = kargs.pop('frame')
frame = int(kargs.pop('frame'))
self.read(frame,**kargs)
elif not kargs:
pass # With no arguments, initialize empty solution
Expand Down

0 comments on commit d2cd7a2

Please sign in to comment.