GithubHelp home page GithubHelp logo

Comments (2)

brutus avatar brutus commented on August 15, 2024

TL;DR

This kinda works as intended. I get that this can be confusing and I will explicitly report skipped values in the future (soon).

Long version

Using no --entries option and --entries 0 yields the same results, because a value of 0 is the default for entries. In either case only the fields from which valid measurements can be parsed are counted - meaning only those, that contain data for SYS, DIA and Pulse.

So if you parse this line 144/82/86, 137/81/75, -, 143/80/68, you get three values, because three valid ones can be parsed.

If entries is set to a value > 0 though, it is guarantied to yield that much measurements per line, even if there are not enough (or more). So None measurements are created for skipped measurements to keep things aligned.

This is the case for both explicitly skipped (i.g. marked by -) or implicitly skipped (i.g. not enough values on the line) ones. Such a None measurement means, here should be one but it was missing.

Since skipped measurements are important in a context where entires is set to some value > 0, they are counted and reported as values too. In a context where entries is not set or < 1, implicitly skipped values can't be detected anyway and so are completely ignored.

from bpdiag.

brutus avatar brutus commented on August 15, 2024

I wrote a quick fix. If you run it against the example file like this :

./bpdiag.py ../examples/bp_values.txt

You should get the following output:

Parsed 24 values (4 skipped)...
Statistics (min, max, avg):
:: SYS...: 119, 144, 135
:: DIA...:  75,  87,  80
:: PULSE.:  60,  99,  71

Only those values explicitly marked are skipped are reported. If you run it with --entries set, like this:

./bpdiag.py --entries 4 ../examples/bp_values.txt

Parsed 28 values (8 skipped)...
Statistics (min, max, avg):
:: SYS...: 119, 144, 135
:: DIA...:  75,  87,  80
:: PULSE.:  60,  99,  71

You should also get the implicitly skipped ones.

As I said, just a quick fix (I hope). A complete refactoring is due for next month or so. Just comment if you got something else in mind.

from bpdiag.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.