voxelmorph icon indicating copy to clipboard operation
voxelmorph copied to clipboard

Fixed deprecated inspect.getargspec() dependency in torch/modelio.py

Open inhuszar opened this issue 2 years ago • 2 comments

Code is not yet tested. Please verify my solution.

inhuszar avatar Sep 25 '23 22:09 inhuszar

Thanks @inhuszar. Didn't realize getargspec was deprecated all the way back in python 3.0

The line params.update(kwonlydefaults) looks like it might be a bug/typo, no? params isn't a variable

ahoopes avatar Sep 26 '23 15:09 ahoopes

Good point, @ahoopes ! I originally inserted this line on purpose into the equivalent implementation in the Neurite repository, where params stands as a temporary placeholder for self.config: https://github.com/adalca/neurite/pull/75/commits/30090b7d4b13577b33ef837ff7c81d0d1b82c7c3

Here, it appears by mistake, and params should be replaced by self.config. Please check the documentation of inspect.getfullargspec() to see if this new addition is aligned with the original purpose of store_config_args.

inhuszar avatar Sep 26 '23 15:09 inhuszar