Skip to content

omnilab/codata API reference

Floor
Provider · Omnilab
Version
1.x
Conformance suite
not wired
Verified for real
Its README does not say
Licence
MIT
composer require omnilab/codata:1.x-dev

Read from the package's own PHP files at the commit add501303bcb: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnilab\Codata

  • CodataSource class

    The fundamental physical constants of CODATA, as NIST publishes them (physics.nist.gov/cuu/Constants): each constant an entity - the proton mass, the speed of light in vacuum, the Newtonian constant of gravitation... -, by NIST's short name ("mp", "c", "bg") or its name, with its value, standard uncertainty and unit (a Quantity), whether it is exact, the value as NIST writes it, and the adjustment it comes from (2022); a search by words of their names.

    5 methods · 3 constants

  • CodataSourceFactory class

    CODATA's fundamental physical constants, as NIST publishes them: each constant by its short name or its name, its value, uncertainty and unit; a search - no key needed, two calls in all.

    2 options

Omnilab\Codata

CodataSource class

final class CodataSource extends HttpSource CodataSource.php:32

The fundamental physical constants of CODATA, as NIST publishes them (physics.nist.gov/cuu/Constants): each constant an entity - the proton mass, the speed of light in vacuum, the Newtonian constant of gravitation... -, by NIST's short name ("mp", "c", "bg") or its name, with its value, standard uncertainty and unit (a Quantity), whether it is exact, the value as NIST writes it, and the adjustment it comes from (2022); a search by words of their names.

Two calls in all, whatever is asked after: NIST's text table of every value (allascii.txt) and its list of every constant, which gives each its short name; both kept for the source's life. No key; US government work.

const BASE_URI = 'https://physics.nist.gov/'
const TABLE = 'cuu/Constants/Table/allascii.txt'

The text table of every value, and the list that names each constant.

const LIST = 'cgi-bin/cuu/Category?view=html&All+values.x=87&All+values.y=21'

CodataSource::getName()

public function getName(): string

CodataSource::capabilities()

public function capabilities(): array

CodataSource::entity()

public function entity(Identifier|string $id): ?Entity

A constant by NIST's short name ("mp", "codata:mp", its NIST page) or by its name, NIST's or the table's ("proton mass", "proton mag.

mom.", case aside); another base's identifier is refused before any call; null when no constant has that name.

public function search(Query $query): Page

The constants whose name holds every word of the text (case aside): the name itself first, then the names that begin with the text, then the others, each in NIST's order (alphabetical); a domain other than "other" answers nothing (the core has no physics: a constant is of Domain::OTHER).

CodataSource::adjustment()

public function adjustment(): ?string

The adjustment the values come from: "2022" (read from the table).

CodataSourceFactory class

final class CodataSourceFactory extends SourceFactory CodataSourceFactory.php:19

CODATA's fundamental physical constants, as NIST publishes them: each constant by its short name or its name, its value, uncertainty and unit; a search - no key needed, two calls in all.

options: mailto: 'support@glitchr.io' # in the User-Agent base_uri: 'https://physics.nist.gov/'

Options

OptionDefault
throttle0.0
base_uriCodataSource::BASE_URI