-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev' into master
- Loading branch information
Showing
12 changed files
with
174 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from dataclasses import (dataclass, | ||
field) | ||
|
||
from pyro.TimeElapsed import TimeElapsed | ||
|
||
|
||
@dataclass | ||
class CompileData: | ||
time: TimeElapsed = field(init=False, default_factory=TimeElapsed) | ||
scripts_count: int = field(init=False, default_factory=int) | ||
success_count: int = field(init=False, default_factory=int) | ||
command_count: int = field(init=False, default_factory=int) | ||
|
||
def __post_init__(self): | ||
self.time = TimeElapsed() | ||
|
||
@property | ||
def failed_count(self) -> int: | ||
return self.command_count - self.success_count | ||
|
||
def to_string(self): | ||
raw_time, avg_time = ('{0:.3f}s'.format(t) | ||
for t in (self.time.value(), self.time.average(self.success_count))) | ||
|
||
return f'Compile time: ' \ | ||
f'{raw_time} ({avg_time}/script) - ' \ | ||
f'{self.success_count} succeeded, ' \ | ||
f'{self.failed_count} failed ' \ | ||
f'({self.scripts_count} scripts)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from dataclasses import (dataclass, | ||
field) | ||
|
||
from pyro.TimeElapsed import TimeElapsed | ||
|
||
|
||
@dataclass | ||
class PackageData: | ||
time: TimeElapsed = field(init=False, default_factory=TimeElapsed) | ||
file_count: int = field(init=False, default_factory=int) | ||
|
||
def __post_init__(self): | ||
self.time = TimeElapsed() | ||
|
||
def to_string(self): | ||
raw_time, avg_time = ('{0:.3f}s'.format(t) | ||
for t in (self.time.value(), self.time.average(self.file_count))) | ||
|
||
return f'Package time: ' \ | ||
f'{raw_time} ({avg_time}/file, {self.file_count} files)' |
Oops, something went wrong.