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

Replacement Options File Parser #97

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

TomNicholas
Copy link
Collaborator

I'm trying to write a replacement BOUT Options File Parser to replace the boutdata.BoutOptionsFile class, which solves the issues in #94. The biggest difference is that this version has lots of tests.

Due to the bespoke structure of BOUT.inp files, I've ended up writing it from scratch, taking a lot of inspiration from the old class. For BOUT v5 I think the options file format should be changed to follow YAML strictly, but this is for until then.

Currently a work-in-progress, but feedback is welcome.

@TomNicholas TomNicholas added enhancement New feature or request work in progress Not ready to merge labels Dec 19, 2019
@TomNicholas TomNicholas self-assigned this Dec 19, 2019
@pep8speaks
Copy link

pep8speaks commented Dec 19, 2019

Hello @TomNicholas! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 16:90: E501 line too long (93 > 89 characters)
Line 52:24: E701 multiple statements on one line (colon)
Line 229:13: E117 over-indented (comment)
Line 230:13: E117 over-indented (comment)
Line 233:13: E117 over-indented (comment)
Line 234:13: E117 over-indented (comment)
Line 308:13: E265 block comment should start with '# '

Line 118:1: W293 blank line contains whitespace
Line 174:1: E305 expected 2 blank lines after class or function definition, found 1
Line 219:90: E501 line too long (91 > 89 characters)
Line 244:63: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 291:5: E265 block comment should start with '# '
Line 292:5: E265 block comment should start with '# '
Line 307:19: W291 trailing whitespace
Line 314:90: E501 line too long (90 > 89 characters)
Line 325:90: E501 line too long (93 > 89 characters)
Line 334:90: E501 line too long (92 > 89 characters)
Line 338:90: E501 line too long (98 > 89 characters)
Line 339:48: E261 at least two spaces before inline comment
Line 339:49: E262 inline comment should start with '# '
Line 342:90: E501 line too long (94 > 89 characters)

Comment last updated at 2020-01-07 11:30:47 UTC

@codecov-io
Copy link

codecov-io commented Dec 20, 2019

Codecov Report

Merging #97 into master will increase coverage by 7.94%.
The diff coverage is 93.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
+ Coverage   47.89%   55.83%   +7.94%     
==========================================
  Files          11       12       +1     
  Lines        1069     1490     +421     
  Branches      214      354     +140     
==========================================
+ Hits          512      832     +320     
- Misses        496      568      +72     
- Partials       61       90      +29
Impacted Files Coverage Δ
xbout/boutdataset.py 68.8% <100%> (+1.41%) ⬆️
xbout/options.py 93% <93%> (ø)
xbout/plotting/animate.py 44% <0%> (+1.03%) ⬆️
xbout/boutdataarray.py 65.78% <0%> (+2.82%) ⬆️
xbout/load.py 79.72% <0%> (+4.21%) ⬆️

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 46b13c5...e4cc1b2. Read the comment docs.



SECTION_DELIM = ':'
COMMENT_DELIM = ['#', ';']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BOUT++ has dropped support for ; as a comment character, I doubt you'll come across an input file that uses them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work in progress Not ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants