Skip to main content

An implementation of the GRIM test, in Python

Project description

The GRIM test

An implementation of the GRIM test, in python

Beta: Work in progress

This package is based on the GRIM test first highlighted by Heathers & Brown in their 2016 paper.

The test makes use of a simple numerical property to identify if the mean of integer values has been correctly calculated.

You don't need the original integer values. You just need the mean and the number of items in the list (this is usually referred to as 'n')

What about rounding?

This implementation supports all the rounding types currently supported in Python 3.8. (ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR¶, ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_UP, ROUND_05UP)

Example:

import grim
import decimal

# mean is 11.09 and n is 21
print(grim.mean_tester.consistency_check('11.09', '21', decimal.ROUND_HALF_UP))

This will return False as the mean could not be correct given a list of 21 integers (and using ROUND_HALF_UP rounding.)

You can pass in the numbers as Strings or Decimals, this avoids floating point accuracy issues.

How can I find out more?

James Heathers has published articles that explain how the technique works and how he used it to expose inconsistencies in scientific papers.

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

grim-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grim-0.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file grim-0.0.1.tar.gz.

File metadata

  • Download URL: grim-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for grim-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fbdcdc10f22e4df287ee94eac792d91303d1ea7671641c1372fc86ef0f966581
MD5 415d9ab09aa29ed83dc8eba4c2235b12
BLAKE2b-256 35a5d4f7f88369b031075364a7ed54579d103e2dd94918afbd6ee1d78cd5bd8e

See more details on using hashes here.

File details

Details for the file grim-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: grim-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for grim-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e34d9ca9bd2eb9350ae69e51ed2d595e5c9577acba38c736a38334ad6115c242
MD5 7d6692021a1c999c82d1fdb261bc3d25
BLAKE2b-256 d2127947b180de28ab84af8c0cb045a7577b23a7ff8226cc634e68f19c4f6d97

See more details on using hashes here.

Supported by

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