Skip to content

Commit 7307ece

Browse files
committed
first commit
0 parents  commit 7307ece

File tree

79 files changed

+3445
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3445
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright 2021 United Kingdom Research and Innovation
2+
3+
Authors: Rhys Evans
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
3. Neither the name of the copyright holder nor the names of its contributors
13+
may be used to endorse or promote products derived from this software
14+
without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26+
POSSIBILITY OF SUCH DAMAGE.

extraction_methods/.DS_Store

6 KB
Binary file not shown.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# encoding: utf-8
2+
"""
3+
4+
"""
5+
__author__ = "Rhys Evans"
6+
__date__ = "07 Jun 2021"
7+
__copyright__ = "Copyright 2018 United Kingdom Research and Innovation"
8+
__license__ = "BSD - see LICENSE file in top-level package directory"
9+
__contact__ = "[email protected]"
10+
11+
from abc import ABC, abstractmethod
12+
13+
14+
class ExtractionMethod(ABC):
15+
"""
16+
Class to act as a base for all extracion methods. Defines the basic method signature
17+
and ensure compliance by all subclasses.
18+
"""
19+
20+
def __init__(self, **kwargs):
21+
"""
22+
Set the kwargs to generate instance attributes of the same name
23+
24+
:param kwargs:
25+
"""
26+
# Set default processor settings
27+
if "default_conf" in kwargs:
28+
self._set_attrs(kwargs["default_conf"])
29+
# Override with specific processor settings
30+
self._set_attrs(kwargs)
31+
32+
def _set_attrs(self, conf: dict) -> None:
33+
"""
34+
Set instance attributes
35+
36+
:param conf:
37+
"""
38+
for key, value in conf.items():
39+
setattr(self, key, value)
40+
41+
@abstractmethod
42+
def run(self, body: dict, **kwargs) -> dict:
43+
"""
44+
Run the extration method
45+
46+
:param body:
47+
:param kwargs:
48+
49+
:return body:
50+
"""
6 KB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# encoding: utf-8
2+
"""
3+
"""
4+
__author__ = "Rhys Evans"
5+
__date__ = "27 May 2021"
6+
__copyright__ = "Copyright 2018 United Kingdom Research and Innovation"
7+
__license__ = "BSD - see LICENSE file in top-level package directory"
8+
__contact__ = "[email protected]"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)