Bladeren bron

Create configuration file

Arkadiusz Ryś 2 jaren geleden
bovenliggende
commit
e3c3cc778c
3 gewijzigde bestanden met toevoegingen van 22 en 6 verwijderingen
  1. 20 0
      data/configuration.toml
  2. 1 5
      spendpoint/bridge.py
  3. 1 1
      tasks.py

+ 20 - 0
data/configuration.toml

@@ -0,0 +1,20 @@
+[server]
+host = "0.0.0.0"
+port = 8000
+
+[[services]]
+name = "outliers"
+namespace = "https://ontology.rys.app/dt/function/outlier"
+call = "outlier_service"
+endpoint = "http://127.0.0.1:9090/api/csv/outlier"
+timeout = 5 # How many seconds we wait for a result
+
+[[services]]
+name = "example"
+namespace = "https://ontology.rys.app/dt/function/example"
+call = "example_service"
+
+[[services]]
+name = "outliers"
+namespace = "https://ontology.rys.app/dt/function/conversion"
+call = "conversion_service"

+ 1 - 5
spendpoint/bridge.py

@@ -7,11 +7,7 @@ from typing import Union
 arklog.set_config_logging()
 
 
-def fetch_outliers(
-        file_name: str = "rotation.csv",
-        column: Union[str, int] = 2,
-        iri: str = "<http://ua.be/drivetrain/description/artifacts/artifacts#drivetrain-sensor-data-v1>"
-    ) -> Graph:
+def fetch_outliers(file_name: str, column: Union[str, int], iri: str) -> Graph:
     """"""
     outlier_service_url = "http://127.0.0.1:9090/api/csv/outlier"
     try:

+ 1 - 1
tasks.py

@@ -20,8 +20,8 @@ def test(c):
 def migrate_requirements(c):
     """Copy requirements from the requirements.txt file to pyproject.toml."""
     lines = Path("requirements.txt").read_text().split("\n")
-    requirements = {"spendpoint": [], "test": [], "doc": [], "dev": []}
     current = "spendpoint"
+    requirements = {current: [], "test": [], "doc": [], "dev": []}
     for line in lines:
         if line.startswith("#"):
             candidate = line[1:].lower().strip()