Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 38 additions & 19 deletions 04_workdir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,49 @@
# ---- Logging -----
# -------------------------------------
logging:
handlers:
file:
filename: "logs/my_saezapp_logger.log"
handlers:
file:
filename: logs/my_saezapp_logger.log

loggers:
default:
level: DEBUG
pkg_infra:
level: INFO
handlers: [file, console]
propagate: false
download_manager:
level: INFO
handlers: [file, console]
propagate: false
ontograph:
level: INFO
handlers: [file, console]
propagate: false

root:
level: WARNING
handlers: [file, console]

# -------------------------------------
# ---- Integrations -----
# -------------------------------------
integrations: # New question: store the big yaml?
# OntoGraph
ontograph:
settings:
- enabled: true # This will be switch <--- what should be the default value?
- cache_path: "ontograph_config.yaml"
- source_ontology: "chebi"
- backend: "graphblas"
ontograph:
settings:
- enabled: true # This will be switch <--- what should be the default value?
- cache_path: ontograph_config.yaml
- source_ontology: chebi
- backend: graphblas

# Download manager
download_manager:
settings:
enabled: true # This will be switch <--- what should be the default value?
path: "/tmp"
backend: "requests"

url: "https://getsamplefiles.com/download/txt/sample-1.txt"
dest: false
newer_than: null
older_than: null
download_manager:
settings:
enabled: true # This will be switch <--- what should be the default value?
path: /tmp
backend: requests
url: https://getsamplefiles.com/download/txt/sample-1.txt
dest: false
newer_than:
older_than:
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ report_level = "INFO"

# ---- Ruff: a fast Python linter and formatter.
[tool.ruff]
exclude = [
"sandbox/"
]
extend-include = ["*.ipynb"]
line-length = 80
target-version = "py312"
Expand Down
39 changes: 39 additions & 0 deletions sandbox/use_case_downloaders.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import pkg_infra

from ontograph.client import ClientCatalog, ClientOntology
from ontograph.downloader import PoochDownloaderAdapter
from ontograph.config.settings import DEFAULT_CACHE_DIR

def main():
workspace = './'

# Create a session for the app
session = pkg_infra.get_session(workspace=workspace, include_location=True)

# Get logger from the session
logger = session.get_logger()

# Add simple messages to the current logger
logger.info('This is an INFO message')
logger.debug('This is a DEBUG message')
logger.warning('This is a WARNING message')
logger.error('This is an ERROR message')
logger.critical('This is a CRITICAL message')

# Call a given downloader from OntoGraph
downloader = PoochDownloaderAdapter(cache_dir=DEFAULT_CACHE_DIR)

# Download a catalog
catalog = ClientCatalog(cache_dir='./data/out', downloader=downloader)
catalog.load_catalog()

# print the schema tree
#catalog.print_catalog_schema_tree()

# Download a given ontology
client = ClientOntology(cache_dir='./data/out', downloader=downloader)
client.load(source='go') # catalog download

if __name__ == '__main__':

main()
Loading