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 theConfig
dictionary constructor:"UnitConverter": converter.UnitConverter()
- Add the following import line:
-
Reload your knowledge graph to run the inferencer over it
Loading unit definition and translation files
-
To load your own unit definition and translation files, run
importconverterdict 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 Width=nanometre
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for whyis-unit-converter-0.0.1a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83b4dc4fffdd5bab86bf12181c61314be08cf94eb3c7187248c0dd3735173162 |
|
MD5 | 2a7750b1aa0b7589869b8716534cf84b |
|
BLAKE2b-256 | 40f4e4abba14e35bf0da29ab1abcc55d5074fecb11e92a51a3c788a9236b8ea8 |
Close
Hashes for whyis_unit_converter-0.0.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70d5976e89bca01d8615ef60c7989f6be0f19457ef0a17b5e1714a3bea88e5f7 |
|
MD5 | 7976eac019b329d8e6de2e14f2a13b05 |
|
BLAKE2b-256 | 6a9d0f47fdf3d94809df08ab23b331e30e7ced3fa85c8c7baa7f03ad213628fa |