Skip to main content

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:

from grim import mean_tester
import decimal

# mean is 11.09 and n is 21
print(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.

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.2.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.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grim-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 7fce89a6db5fe9073d1f84551c984102fcc7801ce1dbcc01afe27e235da41139
MD5 d565feccfb6f8a7e54e7fe83134b25cb
BLAKE2b-256 bf28e205affb523e721e9d0f94c62c689fbcb95f0a90090e25d4f68a4037dfce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: grim-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a975b36a5b01677041cba3ab71e73ca4e019a9f9fdc18b7acb3a56ffa589cfa3
MD5 995955144d2bf5f68324e1eac4555bd9
BLAKE2b-256 a8ec67fa57b198d231f9b4ffa60cf716bc765d13cf5db20dee285745d99b94d7

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 Sentry Error logging StatusPage Status page