Skip to content

Commit

Permalink
code fix
Browse files Browse the repository at this point in the history
  • Loading branch information
derpyplops committed May 14, 2023
1 parent 1568cd0 commit 181283f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions elk/plotting/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@

@dataclass
class Plot:
sweeps: list[Path] = field(default_factory=list)
sweep: list[str] = field(default_factory=list)

def execute(self):
sweeps_path = Path.home() / "elk-reporters" / "sweeps"
# in sweeps_path find the most recent sweep
sweep = max(sweeps_path.iterdir(), key=os.path.getctime)
if self.sweeps:
sweep = self.sweeps[0]
if len(self.sweeps) > 1:
if self.sweep:
sweep = sweeps_path / self.sweep[0]
if not sweep.exists():
print(f"No sweep with name {self.sweep[0]} found in {sweeps_path}")
return
if len(self.sweep) > 1:
print(
f"""{len(self.sweeps)} paths specified.
f"""{len(self.sweep)} paths specified.
Only one sweep is supported at this time."""
)
else:
Expand Down

0 comments on commit 181283f

Please sign in to comment.