Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan committed Jun 6, 2024
1 parent 6d3a045 commit ceb375f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 29 deletions.
4 changes: 2 additions & 2 deletions phlop/app/stats_man.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def cli_args_parser():
def verify_cli_args(cli_args):
try:
cli_args.interval = int(cli_args.interval)
if cli_args.yaml:
cli_args.summary = False
except ValueError:
raise ValueError("Interval must be an integer")
if cli_args.yaml:
cli_args.summary = False
sys.argv = [sys.argv[0]] # drop everything!
return cli_args

Expand Down
3 changes: 1 addition & 2 deletions phlop/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from phlop.string import decode_bytes


class ProcessNonZeroExitCode(RuntimeError):
...
class ProcessNonZeroExitCode(RuntimeError): ...


def run(cmd, shell=True, capture_output=True, check=False, print_cmd=True, **kwargs):
Expand Down
14 changes: 4 additions & 10 deletions phlop/run/mpirun_stats_man.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
#
#

import logging
import os
import sys
import logging

import numpy as np
import psutil
import yaml
from phlop.app import stats_man as sman
from phlop.dict import ValDict
from phlop.proc import run_raw

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)


MPI_RANK = os.environ.get("OMPI_COMM_WORLD_RANK")


def verify_cli_args(cli_args):
try:
cli_args.interval = int(cli_args.interval)
if cli_args.yaml:
cli_args.yaml = f"{cli_args.yaml}.{MPI_RANK}.yaml"
cli_args.summary = False
except ValueError:
raise ValueError("Interval must be an integer")
if cli_args.yaml:
cli_args.yaml = f"{cli_args.yaml}.{MPI_RANK}.yaml"
cli_args.summary = False
sys.argv = [sys.argv[0]] # drop everything!
return cli_args

Expand Down
7 changes: 1 addition & 6 deletions phlop/run/stats_man.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
#
#

import logging
import sys
import logging

import numpy as np
import psutil
import yaml
from phlop.app import stats_man as sman
from phlop.dict import ValDict
from phlop.proc import run_raw

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
Expand Down
3 changes: 1 addition & 2 deletions phlop/testing/parallel_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
from phlop.testing.test_cases import *


class TestCaseFailure(Exception):
...
class TestCaseFailure(Exception): ...


class LoggingMode(Enum):
Expand Down
8 changes: 5 additions & 3 deletions phlop/testing/test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ def load_test_cases_in(
tests += [
TestCase(
cmd=f"{test_cmd_pre} {cmd} {test_cmd_post}".strip(),
log_file_path=None
if not log_file_path
else f"{log_file_path}/{suite._testMethodName}",
log_file_path=(
None
if not log_file_path
else f"{log_file_path}/{suite._testMethodName}"
),
**kwargs,
)
]
Expand Down
6 changes: 2 additions & 4 deletions tests/_phlop/os_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@


class PykulOsTest(unittest.TestCase):
def test_a(self):
...
def test_a(self): ...

def test_b(self):
...
def test_b(self): ...

0 comments on commit ceb375f

Please sign in to comment.