Skip to content

Commit

Permalink
Try fixing the imports again
Browse files Browse the repository at this point in the history
  • Loading branch information
camposandro committed Oct 9, 2023
1 parent a99e52a commit bcb75b4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
41 changes: 31 additions & 10 deletions benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
"""Two sample benchmarks to compute runtime and memory usage.
import benchmarking_asv as bench

For more information on writing benchmarks:
https://asv.readthedocs.io/en/stable/writing_benchmarks.html."""

import example_benchmarks
class TimeSuite: # pylint: disable=too-few-public-methods
"""An example benchmark that times the performance of various kinds
of iterating over dictionaries in Python."""

def __init__(self):
self.d = {}

def time_computation():
"""Time computations are prefixed with 'time'."""
example_benchmarks.runtime_computation()
def setup(self):
self.d = {}
for x in range(500):
self.d[x] = None

def time_keys(self):
"""Time first method."""
bench.example_module.run_time_computation()

def mem_list():
"""Memory computations are prefixed with 'mem' or 'peakmem'."""
return example_benchmarks.memory_computation()
def time_iterkeys(self):
"""Time second method."""
bench.example_module.run_time_computation()

def time_range(self):
"""Time third method."""
bench.example_module.run_time_computation()

def time_xrange(self):
"""Time fourth method."""
bench.example_module.run_time_computation()


class MemSuite: # pylint: disable=too-few-public-methods
"""An example benchmark that times memory consumption."""

def mem_list(self):
return bench.example_module.run_mem_computation()
14 changes: 0 additions & 14 deletions src/benchmarking_asv/example_benchmarks.py

This file was deleted.

Empty file removed tests/benchmarking_asv/conftest.py
Empty file.
6 changes: 3 additions & 3 deletions tests/benchmarking_asv/test_example_module.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""An example module containing testing of mock functions."""

import benchmarking_asv
from benchmarking_asv import example_module


def test_greetings() -> None:
"""Verify the output of the `greetings` function"""
output = benchmarking_asv.example_module.greetings()
output = example_module.greetings()
assert output == "Hello from LINCC-Frameworks!"


def test_meaning() -> None:
"""Verify the output of the `meaning` function"""
output = benchmarking_asv.example_module.meaning()
output = example_module.meaning()
assert output == 42

0 comments on commit bcb75b4

Please sign in to comment.