Commit 72737fdd authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch '97_fix_database_prototype' into 'master'

Fix database prototype

Closes #97

See merge request !121
parents 285a4e6d 56468667
Pipeline #40553 failed with stages
in 24 minutes and 33 seconds
...@@ -5,7 +5,6 @@ repos: ...@@ -5,7 +5,6 @@ repos:
rev: stable rev: stable
hooks: hooks:
- id: black - id: black
language_version: python3.6
exclude: beat/core/test/prefix/algorithms/errors/syntax_error/1.py|beat/core/test/prefix/databases/invalid/1.py exclude: beat/core/test/prefix/algorithms/errors/syntax_error/1.py|beat/core/test/prefix/databases/invalid/1.py
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0 rev: v2.0.0
......
...@@ -7,15 +7,15 @@ from beat.backend.python.database import View ...@@ -7,15 +7,15 @@ from beat.backend.python.database import View
class FooView(View): class FooView(View):
def setup( def setup(
self, self, root_folder, outputs, parameters, start_index=None, end_index=None,
root_folder,
outputs,
parameters,
force_start_index=None,
force_end_index=None,
): ):
"""Initializes the database""" """Initializes the database"""
# DO NOT REMOVE: this is required to setup the view internal state
super().setup(root_folder, outputs, parameters, start_index, end_index)
# Add custom setup code here
return True return True
def index(self, root_folder, parameters): def index(self, root_folder, parameters):
......
...@@ -41,6 +41,15 @@ from beat.backend.python.database import View as BaseView ...@@ -41,6 +41,15 @@ from beat.backend.python.database import View as BaseView
class View(BaseView): class View(BaseView):
def setup(
self, root_folder, outputs, parameters, start_index=None, end_index=None,
):
"""Initializes the database"""
super().setup(root_folder, outputs, parameters, start_index, end_index)
return True
def index(self, root_folder, parameters): def index(self, root_folder, parameters):
Entry = namedtuple("Entry", ["out"]) Entry = namedtuple("Entry", ["out"])
......
...@@ -41,6 +41,15 @@ from beat.backend.python.database import View as BaseView ...@@ -41,6 +41,15 @@ from beat.backend.python.database import View as BaseView
class View(BaseView): class View(BaseView):
def setup(
self, root_folder, outputs, parameters, start_index=None, end_index=None,
):
"""Initializes the database"""
super().setup(root_folder, outputs, parameters, start_index, end_index)
return True
def index(self, root_folder, parameters): def index(self, root_folder, parameters):
Entry = namedtuple("Entry", ["out"]) Entry = namedtuple("Entry", ["out"])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment