• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

marshallward / f90nml / 289
99%

Build:
DEFAULT BRANCH: master
Ran 07 Dec 2017 05:03AM UTC
Jobs 8
Files 7
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
289

push

travis-ci

marshallward
CLI JSON/YAML support, complex list bugfix, print

Several changes in this patch:

- dicts now include certain metadata to support conversion from `dict`
  to Namelist and vice versa.  This is primarily to support further
  conversion to other formats.

  Currently only includes complex variables (converted to 2-element lists) and
  starting index for arrays.  This could be extended to the formatting
  properties.

- In the same vein, a `todict` function was created to convert the Namelist
  back to a standard Python `dict`.  This `dict` includes the metadata
  mentioned in the previous comment.

- This metadata is used to when reading a `dict` for conversion to `Namelist`.

- Improved support for JSON and YAML conversion.  One-to-one conversion appears
  to work so far.

   - Tests still missing here.  (A broken JSON test is in comments)
   - YAML now uses `safe_load`, to prevent and manage foreign objects
   - JSON reading preserves order, but is not handled in writes or YAML reads

And for some completely unrelated updates...

- Arrays of complex numbers could not be parsed due to a bug in the parser.  We
  were only looking for initial value pairs '=(' but not additional values
  ',('.  This case was added, and it appears to work correctly.

- Intrinsic __str__ support, so that print() now gives namelist-like
  output

   - As part of this, most of `write` was moved to a `writestream` method,
     similar to `read` and `readstream`.

- Finally, test cases were formatted a little more consistently, and the 2/3
  stringIO object issue is handled a little more cleanly now.  We use the
  StringIO.StringIO object in 2.x rather than io.BytesIO, since
  StringIO.StringIO can support either unicode or bytes.  (Note this does not
  exist in 3.x, so in this case we use io.StringIO).

  A similar strategy was used in __str__(), which inspired this change.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an e... (continued)

845 of 918 relevant lines covered (92.05%)

7.32 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
20
100.0
/home/travis/build/marshallward/f90nml/f90nml/cli.py
44
100.0
/home/travis/build/marshallward/f90nml/f90nml/namelist.py
Jobs
ID Job ID Ran Files Coverage
1 289.1 07 Dec 2017 05:04AM UTC 0
91.83
Travis Job 289.1
2 289.2 07 Dec 2017 05:03AM UTC 0
91.39
Travis Job 289.2
4 289.4 07 Dec 2017 05:03AM UTC 0
91.5
Travis Job 289.4
5 289.5 07 Dec 2017 05:03AM UTC 0
91.5
Travis Job 289.5
6 289.6 07 Dec 2017 05:04AM UTC 0
91.5
Travis Job 289.6
7 289.7 07 Dec 2017 05:04AM UTC 0
91.5
Travis Job 289.7
8 289.8 07 Dec 2017 05:05AM UTC 0
91.29
Travis Job 289.8
9 289.9 07 Dec 2017 05:05AM UTC 0
91.39
Travis Job 289.9
Source Files on build 289
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #289
  • 559ca7cf on github
  • Prev Build on master (#288)
  • Next Build on master (#291)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc