Skip to content

Project to fetch quantities and units from ontologies to provide an applied data source to OSW.

Notifications You must be signed in to change notification settings

opensemanticworld/quantities-units

Repository files navigation

quantities-units

Project to fetch quantities and units from ontologies to provide an applied data source to OSW.

Table of Contents

Prerequisites

  • Package Manager:
    • poetry (Recommended)
      • Why? See here!
      • TLDR:
        • Automatically:
          • creates a project specific virtual environment and installs dependencies,
          • manages all project dependencies in a pyproject.toml file,
          • manages exact package versions in a poetry.lock file.
        • Can be used to immediately resolve dependency conflicts.
        • Provides consistent dependency management across all environments for deployments and CI/CD.
    • pip
      • All virtual environments with its dependencies must be installed and managed manually.
      • Requires a requirements.txt file to manage dependencies.
      • Project dependencies are not locked to specific versions.
      • Dependency conflict resolving is way more difficult and possibly produces overhead.
      • Does not provide a way to manage virtual environments.
      • Dependencies in pyproject.toml, which is essential for the Docker-Wrapper-Repository, must be manually created or by using third-party tools like pip-tools.

Usage

Change into the project directory first using a terminal. Then, follow the instructions below.

Windows

Using Poetry

Poetry must be installed first. See this article to configure PyCharm with Poetry.

To create a project specific virtual environment (Python version of your project musst be installed on your machine, consider to use Pyenv Windows to install reqired Python versions first), run:

poetry shell

To initialize the project as a Git repository, run:

git init

To install dependencies, run:

poetry install

Add a new dependency to the project:

poetry add <package-name>

Remove a dependency from the project:

poetry remove <package-name>

Test python code in tests directory:

pytest

Using Pip

All virtual environments with its dependencies must be installed and managed manually.

Ubuntu

Commands listed for Windows can be used on Ubuntu as well. Makefile commands are also available. It is recommended to install virtual environements for different Python versions first, e.g., using Pyenv.

Makefile for Poetry

Create project specific virtuall environment, initialize the project as Git repository and install dependencies and activate the virtual environment:

make setup

Activate the project specific virtual environment (if not already activated):

make activate

Test python code:

make test

Create documentation:

make docs_save

View documentation:

make docs_serve

Clean up compiled files and remove the virtual environment:

make clean

About

Project to fetch quantities and units from ontologies to provide an applied data source to OSW.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages