Skip to main content

No project description provided

Project description

visualacuity

License

This software is available under the GNU General Public License v3.0. See the LICENSE file for more info.

How it works

Much of the behavior for visualacuity is documented in the following spreadsheets, (which are also used for testing the software):

Installation

pip install visualacuity

Example Scripts

Prerequisites

For the example scripts, we'll need to install a few more Python packages: pip install pandas tqdm

Data

Prepare a CSV file with your data. Each row is a "visit," and each column is a field from your EHR. Plus columns will be automatically merged. Example data: (document - no pinhole)

Correction: * Corrected / CC - ... * Uncorrected / SC - ...

Example:

Distance Corrected Left Eye Distance Corrected Left Eye +/- Distance Corrected Right Eye Distance Corrected Right Eye +/-
20/20 +1 20/40 -2
CF HM

Data Quality Report [source: data_quality.py]

python -m visualacuity.cli.examples.data_quality "mydata.csv" "reports/data_quality.csv"

Near / Total Loss Report [source: near_total_loss.py]

python -m visualacuity.cli.examples.near_total_loss "mydata.csv" "reports/near_total_loss.csv"

Plus / Minus Values Report [source: plus_minus.py]

python -m visualacuity.cli.examples.plus_minus "mydata.csv" "reports/plus_minus.csv"

Unexpected Patterns Report [source: unexpected_patterns.py]

python -m visualacuity.cli.examples.unexpected_patterns "mydata.csv" "reports/unexpected_patterns.csv"

Visit Stats Report [source: visit_stats.py]

python -m visualacuity.cli.examples.visit_stats "mydata.csv" "reports/visit_stats.csv"

VA Distribution Report [source: va_distribution.py]

python -m visualacuity.cli.examples.va_distribution "mydata.csv" "reports/va_distribution.csv" --plot-file "reports/va_distribution.pdf"

Example Usage

import visualacuity
from visualacuity import *

#############
# Basic usage
parsed = visualacuity.parse_visit({
    "Left Eye Distance SC": "20/30 -1",
    "Right Eye Near CC": "J5",
})

assert parsed == {
    "Left Eye Distance SC": VisitNote(
        text="20/30 -1",
        extracted_value="20/30",
        plus_letters=[-1],
        laterality=OS,
        distance_of_measurement=DISTANCE,
        correction=SC,
        va_format=SNELLEN,
        snellen_equivalent=(20, 30),
        log_mar_base=0.17609125905568127,
        log_mar_base_plus_letters=0.20107900637734125
    ),
    "Right Eye Near CC": VisitNote(
        text="J5",
        extracted_value="J5",
        laterality=OD,
        distance_of_measurement=NEAR,
        correction=CC,
        va_format=JAEGER,
        snellen_equivalent=(20, 40),
        log_mar_base=0.3010299956639812,
        log_mar_base_plus_letters=0.3010299956639812,
    ),
}

###########################
# "Plus" columns are merged

visit_data = {
    "Both Eyes Near CC": "20/20",
    "Both Eyes Near CC Plus": "+2"
}

parsed = visualacuity.parse_visit(visit_data)

assert parsed == {
    "Both Eyes Near CC": VisitNote(
        text="20/20",
        text_plus="+2",
        laterality=OU,
        distance_of_measurement=NEAR,
        correction=CC,
        va_format=SNELLEN,
        plus_letters=[+2],
        extracted_value="20/20",
        snellen_equivalent=(20, 20),
        log_mar_base=0.0,
        log_mar_base_plus_letters=-0.041646245536099975
    )
}

Contributing

How to publish to PyPi

  1. Bump version in src/visualacuity-python/Cargo.toml
  2. Commit that file and all other changes to main or staging
  3. Push main or staging branch to github
  4. Check status on GitHub Actions
  5. If the build is successful, tag the repo with the new version, e.g.: git tag "python-0.1.0a5"
    • Prepend test- to publish to TestPyPi (e.g. test-python-0.1.0a5).
  6. Push with --tags, e.g.: git push --tags
  7. Check status on GitHub Actions
  8. Test new install. (Note: sometimes it doesn't work on the first try — caching or something)
    • TestPyPi: pip install --index-url https://test.pypi.org/legacy/ visualacuity==0.1.0a5
    • PyPi: pip install visualacuity==0.1.0a5

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

visualacuity-0.1.0a7.tar.gz (50.4 kB view details)

Uploaded Source

Built Distributions

visualacuity-0.1.0a7-cp37-abi3-win_amd64.whl (969.9 kB view details)

Uploaded CPython 3.7+ Windows x86-64

visualacuity-0.1.0a7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

visualacuity-0.1.0a7-cp37-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

visualacuity-0.1.0a7-cp37-abi3-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

File details

Details for the file visualacuity-0.1.0a7.tar.gz.

File metadata

  • Download URL: visualacuity-0.1.0a7.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for visualacuity-0.1.0a7.tar.gz
Algorithm Hash digest
SHA256 3194b253b9a0b5f0c88278a521e0a912ffdc743457f5e7fd912cc3f6685f128c
MD5 c4cf1bb5365fb085186b1d504b026f5a
BLAKE2b-256 71dad977fa61723173c70e86c7f9c6352d6b5355c3d15f7e5c15ec6387a99fac

See more details on using hashes here.

File details

Details for the file visualacuity-0.1.0a7-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for visualacuity-0.1.0a7-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 495f67823b000895cee070179187dd4c64c0766744df2b77d9fbe554fb8147af
MD5 e44d9941b9cfeac865d5e5b452af1137
BLAKE2b-256 a45de475a34bf0fc7fb51c6834b7abd9cd185e88788065549d26925cd09a4bff

See more details on using hashes here.

File details

Details for the file visualacuity-0.1.0a7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for visualacuity-0.1.0a7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a33955dfc7d56613b87c6fb05c9a3b0f5088ac546fa1640a7f1a2c099f0a2dc9
MD5 966dd4ed9f906f3979073b93894c6c18
BLAKE2b-256 07c4b440c76dfb3b9395e2cac073ca10a87d8b75d644358bad7d661ea849f17d

See more details on using hashes here.

File details

Details for the file visualacuity-0.1.0a7-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for visualacuity-0.1.0a7-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c20299967ed53da8cce7b2caca21d2fc2d6dfaee5ea469218a6b495b4da9d01
MD5 12812a74e7ad7f29417819a5d0c8f6e5
BLAKE2b-256 7783ddfafdcd720e93cc14ef7d80f4455a6026083e6a27db24882bcfaaf38bb3

See more details on using hashes here.

File details

Details for the file visualacuity-0.1.0a7-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for visualacuity-0.1.0a7-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fdf9a37055e49c4abcb2204844665ac11ae38ff16eeb7791198e4f757ce45e94
MD5 11da772e5451999633982a59e837e5d4
BLAKE2b-256 d58d36f716f91693959d466e904c6bf74c1f374dff823c384eca4543330fad19

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page