Skip to content

Commit 73bf5b2

Browse files
committed
change operator shift log to CausalSimple module
1 parent 3b9899d commit 73bf5b2

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/dackar/causal/OperatorShiftLogsProcessing.py renamed to src/dackar/causal/CausalSimple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
if not Token.has_extension('edep'):
5151
Token.set_extension("edep", default=None)
5252

53-
class OperatorShiftLogs(CausalBase):
53+
class CausalSimple(CausalBase):
5454
"""
5555
Class to process OPG Operator Shift Logs dataset
5656
"""

src/dackar/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"type": {
174174
"type": "string",
175175
"description": "Type of causal analysis",
176-
"enum": ["general", "phrase", "osl"]
176+
"enum": ["general", "phrase", "simple"]
177177
}
178178
},
179179
"additionalProperties": False

src/dackar/workflows/WorkflowManager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
from ..causal.CausalSentence import CausalSentence
5050
from ..causal.CausalPhrase import CausalPhrase
51-
from ..causal.OperatorShiftLogsProcessing import OperatorShiftLogs
51+
from ..causal.CausalSimple import CausalSimple
5252
from .. import config as defaultConfig
5353

5454
from ..validate import validateToml
@@ -365,8 +365,8 @@ def causal(self):
365365
matcher = CausalSentence(self._nlp, entID=self._entId, causalKeywordID=self._causalID)
366366
elif method == 'phrase':
367367
matcher = CausalPhrase(self._nlp, entID=self._entId, causalKeywordID=self._causalID)
368-
elif method == 'osl':
369-
matcher = OperatorShiftLogs(self._nlp, entID=self._entId, causalKeywordID=self._causalID)
368+
elif method == 'simple':
369+
matcher = CausalSimple(self._nlp, entID=self._entId, causalKeywordID=self._causalID)
370370
else:
371371
raise IOError(f'Unrecognized causal type {method}')
372372
matcher.addEntityPattern(self._entPatternName, self._patterns)

system_tests/dackar.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ emergent_activity = true
4242
conjecture = true
4343

4444
[nlp.causal]
45-
type = 'general' # other options: general: "rule based method", wo: "work order", osl: "operator shift log"
45+
type = 'general' # other options: general: "rule based method", phrase: "short phrase like work order data", simple: "simple causal analysis"
4646

4747
[nlp.outputs]
4848
csv = true

tests/causal/test_causal.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dackar.causal.CausalSentence import CausalSentence
2-
from dackar.causal.OperatorShiftLogsProcessing import OperatorShiftLogs
2+
from dackar.causal.CausalSimple import CausalSimple
33
from dackar.causal.CausalPhrase import CausalPhrase
44
from dackar.config import nlpConfig
55
from dackar.utils.nlp.nlp_utils import generatePatternList
@@ -45,10 +45,10 @@ def processCausalEnt(self):
4545
def get_matcher(self, method):
4646
if method == 'general':
4747
matcher = CausalSentence(self.nlp, entID=self.entId, causalKeywordID=self.causalID)
48-
elif method == 'wo':
48+
elif method == 'phrase':
4949
matcher = CausalPhrase(self.nlp, entID=self.entId, causalKeywordID=self.causalID)
50-
elif method == 'osl':
51-
matcher = OperatorShiftLogs(self.nlp, entID=self.entId, causalKeywordID=self.causalID)
50+
elif method == 'simple':
51+
matcher = CausalSimple(self.nlp, entID=self.entId, causalKeywordID=self.causalID)
5252
else:
5353
raise IOError(f'Unrecognized causal type {method}')
5454
patterns = self.generatePattern()
@@ -71,7 +71,7 @@ def test_general(self):
7171

7272

7373
def test_wo(self):
74-
matcher = self.get_matcher(method='wo')
74+
matcher = self.get_matcher(method='phrase')
7575
matcher(self.doc)
7676
df = matcher.getAttribute('entStatus')
7777
dfCausal = matcher.getAttribute('relationGeneral')
@@ -84,7 +84,7 @@ def test_wo(self):
8484
assert dfCausal['object'].tolist()[0] == 'shaft'
8585

8686
def test_osl(self):
87-
matcher = self.get_matcher(method='osl')
87+
matcher = self.get_matcher(method='simple')
8888
matcher(self.doc)
8989
df = matcher.getAttribute('entStatus')
9090
dfCausal = matcher.getAttribute('relationGeneral')

0 commit comments

Comments
 (0)