Skip to content

Commit

Permalink
appease the linter
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Wheeler-Robinson <[email protected]>
  • Loading branch information
crwr45 committed Feb 1, 2024
1 parent 1a809a1 commit 050c0d8
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
pip install flake8
- name: Run Flake8
# run: flake8 . --ignore=E266,E261,E265,W503 --max-line-length=120 --count
run: flake8 postprocess --ignore=E266,E261,E265,W503 --max-line-length=120 --count # only do postprocessing code
run: flake8 . --ignore=E266,E261,E265,W503 --max-line-length=120 --count # only do postprocessing code
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from vse_sync_pp.parsers.dpll import TimeErrorParser
from vse_sync_pp.plot import Plotter, Axis, TIMESERIES


def main():
"""Plot test data and print files output as JSON to stdout
Expand All @@ -46,5 +47,6 @@ def main():
if not print_loj([item]):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def refimpl(filename, encoding='utf-8'):
"""A reference implementation for tests under:
Expand All @@ -46,6 +47,7 @@ def refimpl(filename, encoding='utf-8'):
'analysis': analyzer.analysis,
}


def main():
"""Run this test and print test output as JSON to stdout"""
aparser = ArgumentParser(description=main.__doc__)
Expand All @@ -56,5 +58,6 @@ def main():
if not print_loj(output):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from vse_sync_pp.parsers.gnss import TimeErrorParser
from vse_sync_pp.plot import Plotter, Axis, TIMESERIES


def main():
"""Plot test data and print files output as JSON to stdout
Expand All @@ -46,5 +47,6 @@ def main():
if not print_loj([item]):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def refimpl(filename, encoding='utf-8'):
"""A reference implementation for tests under:
Expand All @@ -46,6 +47,7 @@ def refimpl(filename, encoding='utf-8'):
'analysis': analyzer.analysis,
}


def main():
"""Run this test and print test output as JSON to stdout"""
aparser = ArgumentParser(description=main.__doc__)
Expand All @@ -56,5 +58,6 @@ def main():
if not print_loj(output):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from vse_sync_pp.parsers.ts2phc import TimeErrorParser
from vse_sync_pp.plot import Plotter, Axis, TIMESERIES


def main():
"""Plot test data and print files output as JSON to stdout
Expand All @@ -46,5 +47,6 @@ def main():
if not print_loj([item]):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def refimpl(filename, encoding='utf-8'):
"""A reference implementation for tests under:
Expand All @@ -44,6 +45,7 @@ def refimpl(filename, encoding='utf-8'):
'analysis': analyzer.analysis,
}


def main():
"""Run this test and print test output as JSON to stdout"""
aparser = ArgumentParser(description=main.__doc__)
Expand All @@ -54,5 +56,6 @@ def main():
if not print_loj(output):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from vse_sync_pp.parsers.phc2sys import TimeErrorParser
from vse_sync_pp.plot import Plotter, Axis, TIMESERIES


def main():
"""Plot test data and print files output as JSON to stdout
Expand All @@ -46,5 +47,6 @@ def main():
if not print_loj([item]):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def refimpl(filename, encoding='utf-8'):
"""A reference implementation for tests under:
Expand All @@ -44,6 +45,7 @@ def refimpl(filename, encoding='utf-8'):
'analysis': analyzer.analysis,
}


def main():
"""Run this test and print test output as JSON to stdout"""
aparser = ArgumentParser(description=main.__doc__)
Expand All @@ -54,5 +56,6 @@ def main():
if not print_loj(output):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@
)
from collections import namedtuple

from vse_sync_pp.plot import Plotter, Axis, TIMESERIES
from vse_sync_pp.plot import Plotter, Axis

from vse_sync_pp.parsers.dpll import TimeErrorParser
from vse_sync_pp.analyzers.ppsdpll import MaxTimeIntervalErrorAnalyzer
from vse_sync_pp.analyzers.analyzer import Config

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def plot_data(analyzer, output):
"""Plot data"""
plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered MTIE (ns)", "mtie"))
Parsed = namedtuple('Parsed',('tau','mtie'))
for tau,sample in analyzer.toplot():
plotter.append(Parsed(tau, sample))
Parsed = namedtuple('Parsed', ('tau', 'mtie'))
for tau, sample in analyzer.toplot():
plotter.append(Parsed(tau, sample))
plotter.plot_scatter(output)


def main():
"""Plot test data and print files output as JSON to stdout
Expand Down Expand Up @@ -65,5 +67,6 @@ def main():
if not print_loj([item]):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def refimpl(filename, config, encoding='utf-8'):
"""A reference implementation for tests under:
Expand All @@ -44,6 +45,7 @@ def refimpl(filename, config, encoding='utf-8'):
'analysis': analyzer.analysis,
}


def main():
"""Run this test and print test output as JSON to stdout"""
aparser = ArgumentParser(description=main.__doc__)
Expand All @@ -55,5 +57,6 @@ def main():
if not print_loj(output):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@
)
from collections import namedtuple

from vse_sync_pp.plot import Plotter, Axis, TIMESERIES
from vse_sync_pp.plot import Plotter, Axis

from vse_sync_pp.parsers.gnss import TimeErrorParser
from vse_sync_pp.analyzers.gnss import MaxTimeIntervalErrorAnalyzer
from vse_sync_pp.analyzers.analyzer import Config

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def plot_data(analyzer, output):
"""Plot data"""
plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered MTIE (ns)", "mtie"))
Parsed = namedtuple('Parsed',('tau','mtie'))
for tau,sample in analyzer.toplot():
plotter.append(Parsed(tau, sample))
Parsed = namedtuple('Parsed', ('tau', 'mtie'))
for tau, sample in analyzer.toplot():
plotter.append(Parsed(tau, sample))
plotter.plot_scatter(output)


def main():
"""Plot test data and print files output as JSON to stdout
Expand Down Expand Up @@ -65,5 +67,6 @@ def main():
if not print_loj([item]):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def refimpl(filename, config, encoding='utf-8'):
"""A reference implementation for tests under:
Expand All @@ -44,6 +45,7 @@ def refimpl(filename, config, encoding='utf-8'):
'analysis': analyzer.analysis,
}


def main():
"""Run this test and print test output as JSON to stdout"""
aparser = ArgumentParser(description=main.__doc__)
Expand All @@ -55,5 +57,6 @@ def main():
if not print_loj(output):
sys.exit(1)


if __name__ == '__main__':
main()
13 changes: 8 additions & 5 deletions tests/sync/G.8272/wander-MTIE-in-locked-mode/DPLL-to-PHC/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@
)
from collections import namedtuple

from vse_sync_pp.plot import Plotter, Axis, TIMESERIES
from vse_sync_pp.plot import Plotter, Axis

from vse_sync_pp.parsers.ts2phc import TimeErrorParser
from vse_sync_pp.analyzers.ts2phc import MaxTimeIntervalErrorAnalyzer
from vse_sync_pp.analyzers.analyzer import Config

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def plot_data(analyzer, output):
"""Plot data"""
plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered MTIE (ns)", "tdev"))
Parsed = namedtuple('Parsed',('tau','tdev'))
for tau,sample in analyzer.toplot():
plotter.append(Parsed(tau, sample))
Parsed = namedtuple('Parsed', ('tau', 'tdev'))
for tau, sample in analyzer.toplot():
plotter.append(Parsed(tau, sample))
plotter.plot_scatter(output)


def main():
"""Plot test data and print files output as JSON to stdout
Expand All @@ -53,7 +55,7 @@ def main():
analyzer = MaxTimeIntervalErrorAnalyzer(Config.from_yaml(CONFIG))
with open_input(args.input) as fid:
analyzer.collect(*parser.parse(fid))

# plot data
output = f'{args.prefix}.png'
plot_data(analyzer, output)
Expand All @@ -65,5 +67,6 @@ def main():
if not print_loj([item]):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def refimpl(filename, config, encoding='utf-8'):
"""A reference implementation for tests under:
Expand All @@ -44,6 +45,7 @@ def refimpl(filename, config, encoding='utf-8'):
'analysis': analyzer.analysis,
}


def main():
"""Run this test and print test output as JSON to stdout"""
aparser = ArgumentParser(description=main.__doc__)
Expand All @@ -55,5 +57,6 @@ def main():
if not print_loj(output):
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@
)
from collections import namedtuple

from vse_sync_pp.plot import Plotter, Axis, TIMESERIES
from vse_sync_pp.plot import Plotter, Axis

from vse_sync_pp.parsers.dpll import TimeErrorParser
from vse_sync_pp.analyzers.ppsdpll import TimeDeviationAnalyzer
from vse_sync_pp.analyzers.analyzer import Config

CONFIG = joinpath(dirname(__file__), 'config.yaml')


def plot_data(analyzer, output):
"""Plot data"""
plotter = Plotter(Axis("tau observation window (s)", "tau", "log"), Axis("filtered TDEV (ns)", "tdev"))
Parsed = namedtuple('Parsed',('tau','tdev'))
for tau,sample in analyzer.toplot():
plotter.append(Parsed(tau, sample))
Parsed = namedtuple('Parsed', ('tau', 'tdev'))
for tau, sample in analyzer.toplot():
plotter.append(Parsed(tau, sample))
plotter.plot_scatter(output)


def main():
"""Plot test data and print files output as JSON to stdout
Expand Down Expand Up @@ -63,5 +65,6 @@ def main():
if not print_loj([item]):
sys.exit(1)


if __name__ == '__main__':
main()
Loading

0 comments on commit 050c0d8

Please sign in to comment.