-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Added Matlab files import tests #4102
Conversation
Looking good :-), ping when its done for review |
@goanpeca This PR is ready to go! |
Yep, our Travis tests are failing because of a new release of Jedi. I'll fix it right away ;-) |
spyder/utils/tests/test_iofuncs.py
Outdated
inf, _ = io.load_matlab(path) | ||
valid = True | ||
for var in sorted(real_values.keys()): | ||
valid = valid and np.sum(real_values[var] == inf[var]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using np.sum
here?
spyder/utils/tests/test_iofuncs.py
Outdated
import numpy as np | ||
import spyder.utils.iofuncs as io | ||
|
||
__location__ = os.path.realpath(os.path.join(os.getcwd(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this a constant, i.e. LOCATION
spyder/utils/tests/test_iofuncs.py
Outdated
@@ -13,13 +13,25 @@ | |||
import numpy as np | |||
import spyder.utils.iofuncs as io | |||
|
|||
__location__ = os.path.realpath(os.path.join(os.getcwd(), | |||
LOCATION = os.path.realpath(os.path.join(os.getcwd(), | |||
os.path.dirname(__file__))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please align this line correctly to be at the same level of os.getcwd()
above.
spyder/utils/tests/test_iofuncs.py
Outdated
os.path.dirname(__file__))) | ||
|
||
|
||
@pytest.fixture | ||
def real_values(): | ||
path = os.path.join(__location__, 'numpy_data.npz') | ||
""" | ||
Loads a Numpy pickled file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loads -> Load
spyder/utils/tests/test_iofuncs.py
Outdated
over several variable types, such as: Matrices/Vectors, Scalar and | ||
Complex numbers, Structs, Strings and Cell Arrays. The set of variables | ||
was defined to allow and test the deep conversion of a compound type, | ||
i.e., A struct that contains other types that need to be converted, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: i.e. a struct
spyder/utils/tests/test_iofuncs.py
Outdated
|
||
This test loads a file stored in MATLAB, the variables defined are | ||
equivalent to the manually converted values done over Numpy. This test | ||
allows to evaluate the function which processes the conversion automa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
automa -> automa-
Fixes #4076
This test allows to confirm and validate the main datatypes defined in MATLAB, including: