Commit d72741d2 authored by Timm Schoening's avatar Timm Schoening
Browse files

added mkdocs documentation

parent 8f90c314
......@@ -12,6 +12,7 @@ import mariqt.directories as miqtd
import mariqt.sources.dship_settings as miqtsds
def getMaxDepthForEvents(dship_events,req_actions):
""" Adds the maximum depth of all actions as another field into the event's dict."""
devop_maxdepth = {}
for event in dship_events:
for req in req_actions:
......@@ -31,6 +32,7 @@ def getMaxDepthForEvents(dship_events,req_actions):
def addEndToDSHIPEventsByLastActionBeforeNextEvent(dship_events):
""" Adds the last action of an event as another field to the event's dict."""
for event in dship_events:
next_event = 0
for a in dship_events[event]['actions']:
......@@ -42,6 +44,7 @@ def addEndToDSHIPEventsByLastActionBeforeNextEvent(dship_events):
dship_events[event]['end'] = next_event
def addEndToDSHIPEventsByLastAction(dship_events):
""" Adds the last action of an event as another field to the event's dict."""
for event in dship_events:
maxt = 0
for a in dship_events[event]['actions']:
......@@ -49,6 +52,7 @@ def addEndToDSHIPEventsByLastAction(dship_events):
dship_events[event]['end'] = maxt
def removeEventsByOtherCruises(dship_events,cruise):
""" Removes all events from list that are not from the given cruise"""
rem = []
for event in dship_events:
if cruise not in event:
......@@ -57,6 +61,7 @@ def removeEventsByOtherCruises(dship_events,cruise):
del dship_events[r]
def renameEvents(dship_events,add_gear=True):
""" Replaces the slash in the event name by a dash and can append the gear (event['code']) as a suffix to the event name"""
add_events = {}
for event in dship_events:
new_event = event.replace("/","-")
......@@ -112,6 +117,7 @@ def findDSHIPSourceFile(path:miqtd.Dir):
def parseDSHIPDeviceOperationsOrEventsFile(path:str,delim="\t",date_fmt="%Y/%m/%d %H:%M:%S"):
""" Tries to read a DSHIP file from disk. Can differentiate between deviceoperations and events files"""
if not os.path.exists(path):
print("Error reading DSHIP event file. No such file:",path)
return []
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