Skip to main content

Unit converter for Whyis

Project description

Whyis-unit-converter

Installation

  • install whyis using this command

    WHYIS_BRANCH=master bash < <(curl -skL https://raw.githubusercontent.com/tetherless-world/whyis/master/install.sh)
    
  • whyis will be installed in /apps/whyis

  • In your knowledge graph directory, add the unit converter agent to the list of inferencers in your config.py file:

    • Add the following import line: import whyis_unit_converter.converter as converter
    • Add the following line to the inferencers item in the Config dictionary constructor: "UnitConverter": converter.UnitConverter()
  • Reload your knowledge graph to run the inferencer over it

Loading unit translation files

  • Your translation files can be in one of the following forms:

    • Unit definitions file. Used to translate compound units or units with non-standard spellings into understandable units. See defining pint units for more specific information about formatting.
    #definitions_file
    joulePerSquareMetre = joule / meter ** 2
    metre = meter
    degreeFahrenheit = 5 / 9 * kelvin; offset: 233.15 + 200 / 9
    
    • URI to unit mapping file. Used to map measurement types to their preferred units, if sio:hasPreferredUnit is not used in your knowledge graph.
    #mapping_file
    CharpyImpactEnergy=joulePerSquareMetre
    CrystalizationTemperature=kelvin
    ThermalDiffusivity=squareMetrePerSecond-Time
    
    • Translation file. Used to translate un-parsable URIs into understandable units. No slug or fragment may contain a dash "-" or slash "/", unless that slug is translated in the translation file. Translations to understandable units are written as below. See defining pint units for more specific information about formatting.
    #translation_file
    minute-Time = minute
    w-mk = watts / meter / kelvin
    mol-m-3 = mole / meter ** 3
    

Testing

  • To test the unit converter, run unitconvertertest from a pip enabled endpoint.

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

whyis-unit-converter-0.0.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

whyis_unit_converter-0.0.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file whyis-unit-converter-0.0.1.tar.gz.

File metadata

  • Download URL: whyis-unit-converter-0.0.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.7

File hashes

Hashes for whyis-unit-converter-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4fba1ee5f545e99e4364ceb92610ac5609246bf6e60c76a6f83591e043b67cb3
MD5 45ae8c26c92ac921b1777c35c2719310
BLAKE2b-256 c641fa57ba9a2ae66b9e1b651ffbe7aab1a2851ddad08e7587bb52ecfdbcacb3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: whyis_unit_converter-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 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/46.1.3 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.7

File hashes

Hashes for whyis_unit_converter-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 971564875bb2b903925e87169c8019de81958a8e1bafbce2ea762dbfa106111b
MD5 5c64198a45294cc400a90735f15cc8c4
BLAKE2b-256 5f29dd607168af2dec52c65178fd665286d74c64b8aa5a7dd1ea7e769357b20a

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