Skip to content

Commit

Permalink
Bugfix for inspect change in reports
Browse files Browse the repository at this point in the history
  • Loading branch information
sserita committed Jan 20, 2023
1 parent 8d86182 commit e0df4f7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pygsti/report/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,11 @@ def _makefactory(self, cls, autodisplay): # , printer=_objs.VerbosityPrinter(1)
argnames = argspec.args
assert(argnames[0] == 'self' and argnames[1] == 'ws'), \
"__init__ must begin with (self, ws, ...)"

newargsig = argsig.replace(parameters= list(argsig.parameters.values())[2:])

#Define a new factory function with appropriate signature

# Strip default values out of parameters so that we don't override the true incoming values with defaults
newargparams = [p.replace(default=_inspect.Parameter.empty) for p in argsig.parameters.values()][2:]
newargsig = _inspect.Signature(newargparams)

signature = str(newargsig)
signature = signature[1:-1] # strip off parenthesis from ends of "(signature)"

Expand Down

0 comments on commit e0df4f7

Please sign in to comment.