Skip to content
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

Fix tests and update examples #36

Merged
merged 28 commits into from
Jun 8, 2018
Merged

Fix tests and update examples #36

merged 28 commits into from
Jun 8, 2018

Conversation

namurphy
Copy link

@namurphy namurphy commented Jun 7, 2018

I am going through and fixing tests, mostly in nei.py and eigenvaluetable.py. I am also about to make a few changes to how things are set up for Travis CI, so I'll need to keep this pull request open to make sure the test settings are correct.

namurphy added 5 commits June 7, 2018 12:56
When EigenData2._get_temperature_index had an input that equals the
boundary, it had been issuing a warning.  I changed this so that the
warning is not issued when the temperature equals the minimum or
maximum temperature in the grid.  When I start a simulation at 10000
K, I no longer get a warning.
@namurphy namurphy added the Status: work in progress Pull requests that are currently being worked on label Jun 7, 2018
@pep8speaks
Copy link

pep8speaks commented Jun 7, 2018

Hello @namurphy! Thanks for updating the PR.

Line 281:5: E303 too many blank lines (2)

Line 91:18: E251 unexpected spaces around keyword / parameter equals
Line 91:20: E251 unexpected spaces around keyword / parameter equals
Line 92:20: E251 unexpected spaces around keyword / parameter equals
Line 92:22: E251 unexpected spaces around keyword / parameter equals
Line 383:80: E501 line too long (104 > 79 characters)
Line 454:20: E251 unexpected spaces around keyword / parameter equals
Line 454:22: E251 unexpected spaces around keyword / parameter equals
Line 472:80: E501 line too long (85 > 79 characters)
Line 632:39: E225 missing whitespace around operator
Line 915:80: E501 line too long (82 > 79 characters)
Line 971:80: E501 line too long (89 > 79 characters)
Line 983:5: E303 too many blank lines (2)
Line 1033:80: E501 line too long (84 > 79 characters)
Line 1037:80: E501 line too long (86 > 79 characters)
Line 1079:5: E303 too many blank lines (2)
Line 1189:80: E501 line too long (83 > 79 characters)
Line 1193:57: E225 missing whitespace around operator
Line 1194:9: E122 continuation line missing indentation or outdented
Line 1195:9: E122 continuation line missing indentation or outdented
Line 1199:1: E302 expected 2 blank lines, found 1
Line 1216:80: E501 line too long (82 > 79 characters)
Line 1222:9: E265 block comment should start with '# '
Line 1226:9: E265 block comment should start with '# '
Line 1233:9: E265 block comment should start with '# '
Line 1233:9: E303 too many blank lines (2)
Line 1238:9: E303 too many blank lines (3)
Line 1240:74: E231 missing whitespace after ','
Line 1240:80: E501 line too long (81 > 79 characters)
Line 1241:36: E231 missing whitespace after ','
Line 1241:62: E228 missing whitespace around modulo operator
Line 1241:80: E501 line too long (85 > 79 characters)
Line 1244:80: E501 line too long (80 > 79 characters)
Line 1248:70: E231 missing whitespace after ','
Line 1249:32: E231 missing whitespace after ','
Line 1252:63: E228 missing whitespace around modulo operator
Line 1252:77: E231 missing whitespace after ','
Line 1252:80: E501 line too long (82 > 79 characters)
Line 1257:80: E501 line too long (80 > 79 characters)
Line 1264:80: E501 line too long (90 > 79 characters)
Line 1275:14: E225 missing whitespace around operator
Line 1281:13: E303 too many blank lines (2)
Line 1284:73: E231 missing whitespace after ','
Line 1284:80: E501 line too long (91 > 79 characters)
Line 1284:91: E502 the backslash is redundant between brackets
Line 1285:25: E127 continuation line over-indented for visual indent
Line 1295:76: E231 missing whitespace after ','
Line 1295:80: E501 line too long (103 > 79 characters)
Line 1313:1: W391 blank line at end of file

Line 8:1: E265 block comment should start with '# '
Line 8:80: E501 line too long (80 > 79 characters)
Line 10:1: E265 block comment should start with '# '
Line 10:80: E501 line too long (80 > 79 characters)
Line 14:1: E265 block comment should start with '# '
Line 16:1: E265 block comment should start with '# '
Line 17:1: E302 expected 2 blank lines, found 1
Line 23:54: E261 at least two spaces before inline comment
Line 23:80: E501 line too long (94 > 79 characters)
Line 30:25: E231 missing whitespace after ','
Line 52:1: E265 block comment should start with '# '
Line 53:1: E265 block comment should start with '# '
Line 79:1: E302 expected 2 blank lines, found 1
Line 134:17: E261 at least two spaces before inline comment
Line 135:17: E261 at least two spaces before inline comment
Line 148:18: E261 at least two spaces before inline comment
Line 167:1: E265 block comment should start with '# '
Line 168:1: E302 expected 2 blank lines, found 1
Line 180:10: E225 missing whitespace around operator

Line 64:28: E225 missing whitespace around operator
Line 87:80: E501 line too long (87 > 79 characters)
Line 100:80: E501 line too long (98 > 79 characters)
Line 190:80: E501 line too long (86 > 79 characters)
Line 191:80: E501 line too long (84 > 79 characters)
Line 197:80: E501 line too long (88 > 79 characters)
Line 206:80: E501 line too long (96 > 79 characters)
Line 215:80: E501 line too long (91 > 79 characters)
Line 223:80: E501 line too long (82 > 79 characters)
Line 259:80: E501 line too long (85 > 79 characters)
Line 269:80: E501 line too long (98 > 79 characters)

Line 13:1: E265 block comment should start with '# '
Line 50:23: E231 missing whitespace after ','
Line 54:9: E265 block comment should start with '# '
Line 54:80: E501 line too long (80 > 79 characters)
Line 55:61: E231 missing whitespace after ','
Line 59:9: E265 block comment should start with '# '
Line 60:9: E265 block comment should start with '# '
Line 71:23: E231 missing whitespace after ','
Line 75:9: E265 block comment should start with '# '
Line 75:80: E501 line too long (80 > 79 characters)
Line 76:61: E231 missing whitespace after ','
Line 80:9: E265 block comment should start with '# '
Line 81:9: E265 block comment should start with '# '
Line 98:19: E231 missing whitespace after ','
Line 98:44: E231 missing whitespace after ','
Line 99:19: E231 missing whitespace after ','
Line 99:44: E231 missing whitespace after ','
Line 101:8: E225 missing whitespace around operator
Line 105:1: E265 block comment should start with '# '
Line 107:1: E265 block comment should start with '# '
Line 108:1: E265 block comment should start with '# '

  • In the file setup.py, following are the PEP8 issues :

Line 28:80: E501 line too long (89 > 79 characters)
Line 29:80: E501 line too long (107 > 79 characters)
Line 34:1: E402 module level import not at top of file
Line 35:1: E402 module level import not at top of file
Line 44:1: E402 module level import not at top of file
Line 46:1: E402 module level import not at top of file
Line 47:1: E402 module level import not at top of file
Line 153:80: E501 line too long (99 > 79 characters)
Line 165:1: E124 closing bracket does not match visual indentation

Comment last updated on June 08, 2018 at 00:33 Hours UTC

namurphy added 19 commits June 7, 2018 14:08
Non-Python files need to be included in MANIFEST.in so that they are
kept track of while running `python setup.py install` and `python
setup.py test`.  This should recursively include everything in the
data directory.
This snuck back in when I pulled in the latest changes from the
astropy affiliated package template.
For many of the packages in requirements/requirements.txt, the minimum
required version is probably more recent that is necessary for most of
these.  The exceptions are NumPy (which had some io changes as of
1.14) and Cython (which had some bugs for ~0.27 that showed up in
PlasmaPy).
There have been problems with some NumPy and SciPy functions dropping
units from Quantity instances.  More recent versions of Astropy with
NumPy 1.13 or 1.14ish can handle these special functions better.  This
will probably be important since users may use NumPy and SciPy
functions in the functions that define density and temperature
evolution.
For some reason I keep getting an error that the coveragerc file has
not been found.  Here I'm handling the coveragerc file (for code test
coverage checking) in the same way as the HDF5 files.
Tests for test_eigenvaluetable.py were timing out in Travis CI because
there was no screen output for 10 minutes.  This now allows 30 minutes
for no screen output.  We will probably want to shorten the tests
though, if possible.
I temporarily commented out a test that depended on ChiantiPy because
it might be causes Travis CI to get stalled and time out.  I also
parametrized another test so that there would be more frequent screen
output, and the tests would be performed independently of each other.
There was a bug in PlasmaPy where there was a TypeError raised when an
int was expected and a numpy.dtype of something like int64 was used.
@codecov-io
Copy link

codecov-io commented Jun 7, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@3f3b078). Click here to learn what that means.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #36   +/-   ##
=========================================
  Coverage          ?   67.95%           
=========================================
  Files             ?        6           
  Lines             ?     1267           
  Branches          ?        0           
=========================================
  Hits              ?      861           
  Misses            ?      406           
  Partials          ?        0
Impacted Files Coverage Δ
nei/data/read_save_ir_rate.py 1.28% <ø> (ø)
nei/classes/nei.py 69.44% <57.14%> (ø)
nei/classes/eigenvaluetable.py 90.56% <62.5%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f3b078...4a0d223. Read the comment docs.

namurphy added 2 commits June 7, 2018 19:41
I also parametrized this to check a few different elements.  For some
reason, there have been some problems with Travis CI in creating
EigenData2 instances for heavier elements (e.g., Fe).
@namurphy
Copy link
Author

namurphy commented Jun 8, 2018

I finally got the tests to pass again on Travis CI, though I'm still having some problems with test_nei_class.py and test_eigenvaluetable.py. The main problem is that the tests time out when the tests include heavier elements like iron. The heavier elements work fine when running the tests on my workstation locally, but for some reason take a lot longer on Travis. I had started to think it may have been memory limitations, but the data files are each ~5 MB so I'm not sure.

@namurphy
Copy link
Author

namurphy commented Jun 8, 2018

Closes #32. Closes #29. <-- These statements tell GitHub to close those issues once the current issue is merged.

@namurphy namurphy changed the title Fix tests and update examples (do not merge yet) Fix tests and update examples Jun 8, 2018
@namurphy namurphy added Status: ready for review PRs that are ready for code review testing and removed Status: work in progress Pull requests that are currently being worked on labels Jun 8, 2018
@namurphy namurphy merged commit 8026539 into NEI-modeling:master Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: ready for review PRs that are ready for code review testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants