Skip to content

Commit

Permalink
docs: Update documentation
Browse files Browse the repository at this point in the history
- Fix docstrings for sensor.py
- Customize mkdocs.yml
  • Loading branch information
argysamo committed May 29, 2022
1 parent c792d78 commit 94ca2f1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
Binary file added docs/assets/eco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions edam/reader/models/observable.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class AbstractObservable(Base):
or `temp_min`, etc.
Attributes:
observable_id:
name: The name of the observable (e.g. Temperature)
ontology: An ontology for the observable
"""
Expand Down
23 changes: 21 additions & 2 deletions edam/reader/models/template.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import csv
import fnmatch
import os
import re
from contextlib import contextmanager

import jinja2schema

from edam import get_logger
from edam import get_logger, home_directory
from edam.reader.regular_expressions import template_file_header, \
for_loop_variables, var_for_line, start_if, end_if, resample_function
from edam.utilities.exceptions import ErrorWithTemplate
Expand Down Expand Up @@ -130,7 +131,6 @@ def resampled(self, value):
else:
self._resampled = None


@property
def preamble(self) -> str:
"""
Expand Down Expand Up @@ -202,3 +202,22 @@ def read_template(template: Template):
f = open(template.path, 'r')
yield f
f.close()


def find_templates_in_directory(directory: str = home_directory) -> [Template]:
"""
Returns a list of templates located in a given directory.
Directory defaults to the home_directory(~/.edam)
:rtype: [Template]
:param directory: Directory to search for templates
:return: list of Template objects
"""
list_of_templates = list()
for folder, _, files in os.walk(os.path.join(directory, 'templates')):
for file in files:
if fnmatch.fnmatch(file, '*.tmpl'):
path = os.path.join(folder, file)
filename, _ = os.path.splitext(file)
templ = Template(path=path)
list_of_templates.append(templ)
return list_of_templates
14 changes: 14 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
site_name: EDAM
theme:
name: material
logo: assets/eco.png
favicon: images/favicon.ico
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to light mode

repo_name: 'EDAM'
repo_url: 'https://github.com/BigDataWUR/EDAM'
copyright: 'Copyright © 2017, Argyrios Samourkasidis'
Expand Down

0 comments on commit 94ca2f1

Please sign in to comment.