Skip to content

Commit

Permalink
version 0.13.3a1 for pipestat 0.6.0a1
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Oct 4, 2023
1 parent 8aaede5 commit 0b430c7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.13.3a1] -- 2023-10-04
### Fixed
- refactor for pipestat 0.6.0a1

## [0.13.2] -- 2023-08-02
### Fixed
- fixed self.new_start overriding checkpoints.
Expand Down
2 changes: 1 addition & 1 deletion pypiper/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.13.2"
__version__ = "0.13.3a1"
21 changes: 12 additions & 9 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def _get_arg(args_dict, arg_name):
return None if arg_name not in args_dict else args_dict[arg_name]

self._pipestat_manager = PipestatManager(
sample_name=self.pipestat_sample_name
record_identifier=self.pipestat_sample_name
or _get_arg(args_dict, "pipestat_sample_name")
or DEFAULT_SAMPLE_NAME,
pipeline_name=self.name,
Expand Down Expand Up @@ -724,7 +724,8 @@ def start_pipeline(self, args=None, multi=False):
self.info("\n----------------------------------------\n")
self.status = "running"
self.pipestat.set_status(
sample_name=self._pipestat_manager.sample_name, status_identifier="running"
record_identifier=self._pipestat_manager.sample_name,
status_identifier="running",
)

# Record the start in PIPE_profile and PIPE_commands output files so we
Expand Down Expand Up @@ -770,7 +771,8 @@ def _set_status_flag(self, status):
prev_status = self.status
self.status = status
self.pipestat.set_status(
sample_name=self._pipestat_manager.sample_name, status_identifier=status
record_identifier=self._pipestat_manager.sample_name,
status_identifier=status,
)
self.debug("\nChanged status from {} to {}.".format(prev_status, self.status))

Expand Down Expand Up @@ -1419,7 +1421,7 @@ def _wait_for_lock(self, lock_file):
)
# self._set_status_flag(WAIT_FLAG)
self.pipestat.set_status(
sample_name=self._pipestat_manager.sample_name,
record_identifier=self._pipestat_manager.sample_name,
status_identifier="waiting",
)
first_message_flag = True
Expand All @@ -1443,7 +1445,7 @@ def _wait_for_lock(self, lock_file):
self.timestamp("File unlocked.")
# self._set_status_flag(RUN_FLAG)
self.pipestat.set_status(
sample_name=self._pipestat_manager.sample_name,
record_identifier=self._pipestat_manager.sample_name,
status_identifier="running",
)

Expand Down Expand Up @@ -1602,7 +1604,7 @@ def report_result(self, key, value, nolog=False, result_formatter=None):

reported_result = self.pipestat.report(
values={key: value},
sample_name=self.pipestat_sample_name,
record_identifier=self.pipestat_sample_name,
result_formatter=rf,
)

Expand Down Expand Up @@ -1684,7 +1686,7 @@ def report_object(
val = {key: message_raw.replace("\t", " ")}

reported_result = self.pipestat.report(
values=val, sample_name=self.pipestat_sample_name, result_formatter=rf
values=val, record_identifier=self.pipestat_sample_name, result_formatter=rf
)
if not nolog:
for r in reported_result:
Expand Down Expand Up @@ -2026,7 +2028,7 @@ def fail_pipeline(self, exc, dynamic_recover=False):
self.info("Failure reason: " + str(exc))
# self._set_status_flag(FAIL_FLAG)
self.pipestat.set_status(
sample_name=self._pipestat_manager.sample_name,
record_identifier=self._pipestat_manager.sample_name,
status_identifier="failed",
)

Expand Down Expand Up @@ -2087,7 +2089,8 @@ def stop_pipeline(self, status=COMPLETE_FLAG):
"""
# self._set_status_flag(status)
self.pipestat.set_status(
sample_name=self._pipestat_manager.sample_name, status_identifier=status
record_identifier=self._pipestat_manager.sample_name,
status_identifier=status,
)
self._cleanup()
elapsed_time_this_run = str(
Expand Down
12 changes: 6 additions & 6 deletions pypiper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,20 +387,20 @@ def split_by_pipes(cmd):
cmdlist = []
newcmd = str()
for char in cmd:
if char is "{":
if char == "{":
stack_brace.append("{")
elif char is "}":
elif char == "}":
stack_brace.pop()
elif char is "(":
elif char == "(":
stack_paren.append("(")
elif char is ")":
elif char == ")":
stack_paren.pop()

if len(stack_brace) > 0 or len(stack_paren) > 0:
# We are inside a parenthetic of some kind; emit character
# no matter what it is
newcmd += char
elif char is "|":
elif char == "|":
# if it's a pipe, finish the command and start a new one
cmdlist.append(newcmd)
newcmd = str()
Expand Down Expand Up @@ -1110,7 +1110,7 @@ def _add_args(parser, args, required):
return parser


def result_formatter_markdown(pipeline_name, sample_name, res_id, value) -> str:
def result_formatter_markdown(pipeline_name, record_identifier, res_id, value) -> str:
"""
Returns Markdown formatted value as string
"""
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-pypiper.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ psutil
pandas
ubiquerg>=0.4.5
yacman
pipestat>=0.4.0
pipestat>=0.6.0a1

0 comments on commit 0b430c7

Please sign in to comment.