Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKalho committed Nov 11, 2024
1 parent dde0e50 commit 1e79770
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,36 +152,29 @@ Therefore you should use the `BaseENVSettings` class.
from scystream.sdk.core import entrypoint
from scystream.sdk.env.settings import BaseENVSettings
class GlobalSettings(BaseENVSettings):
LANGUAGE: str = "de"
class TextDataInputSettings(BaseENVSettings):
TXT_SRC_PATH: str # no default provided, manual setting is a MUST
class DBDataInputSettings(BaseENVSettings):
DATA_TABLE_NAME: str = "nlp_information"
DB_HOST: str = "time.rwth-aachen.de"
DB_PORT: str = 1234
class TopicModellingEntrypointSettings(BaseENVSettings):
TXT_SRC_PATH: str # if no default provided, setting this ENV manually is a MUST
LANGUAGE: str = "de"
text_data: TextDataInputSettings
db_data: DBDataInputSettings
@entrypoint(TopicModellingEntrypointSettings) # Pass it to the Entrypoint
def topic_modelling(settings):
print(f"Running topic modelling, using file: {settings.TXT_SRC_PATH}")
print(f"Running topic modelling, using file: {settings.text_data.TXT_SRC_PATH}")
@entrypoint
def test_entrypint():
print("This entrypoint does not have any configs.")
```

We recommend defining your `GlobalSettings` in an extra file and "exporting" the loaded
Settings to make them accessible to other files.
See an example below:

```python3
from scystream.sdk.env.settings import BaseENVSettings
class GlobalSettings(BaseENVSettings):
LANGUAGE: str = "de"
GLOBAL_SETTINGS = GlobalSettings.load_settings()
```

You can then use the loaded `GLOBAL_SETTINGS` in your other files, by importing them.

## Development of the SDK

### Installation
Expand Down

0 comments on commit 1e79770

Please sign in to comment.