Fixes old call to sort() method - #1
Open
orestesmas wants to merge 1 commit into
Open
Conversation
SPR 'master' fails to load raw ngspice data on python 3.6
As stated somewhere on internet:
>Technical Detail: If you’re transitioning from Python 2 and are familiar with its function of the same name, you should be aware of a >couple important changes in Python 3:
> Python 3’s sorted() does not have a cmp parameter. Instead, only key is used to introduce custom sorting logic.
> key and reverse must be passed as keyword arguments, unlike in Python 2, where they could be passed as positional arguments.
>If you need to convert a Python 2 cmp function to a key function, then check out functools.cmp_to_key(). This tutorial will not cover any examples using Python 2.
>>> from spr import load_raw
>>> data=load_raw('SR-UWB.dat')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/orestes/Documents/Recerca/SuperReg/NgSpice/ngspice/lib/python3.6/site-packages/spr/__init__.py", line 65, in load_raw
ret["vars"].sort(cmp=lambda x, y: int(x["idx"])-int(y["idx"]))
TypeError: 'cmp' is an invalid keyword argument for this function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SPR 'master' fails to load raw ngspice data on python 3.6
As stated somewhere on internet: