diff --git a/docs/setup.rst b/docs/setup.rst index b0c1f01..69519b6 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -15,10 +15,4 @@ Setup a completely fresh environment... conda env create --file environments/nwb_benchmarks.yaml --no-default-packages conda activate nwb_benchmarks -Setup initial machine configuration values with - -.. code-block:: - - nwb_benchmarks setup - You will also need to install the custom network tracking software ``tshark`` using `their instructions `_. diff --git a/environments/nwb_benchmarks.yaml b/environments/nwb_benchmarks.yaml index 6d002ba..07e96ac 100644 --- a/environments/nwb_benchmarks.yaml +++ b/environments/nwb_benchmarks.yaml @@ -6,7 +6,7 @@ dependencies: - pip - pip: - setuptools - - asv == 0.6.2 + - asv == 0.6.1 - numba>=0.58.1 # Pin to specific version for cuda import - psutil - pynwb diff --git a/src/nwb_benchmarks/command_line_interface.py b/src/nwb_benchmarks/command_line_interface.py index 17efb12..acbe844 100644 --- a/src/nwb_benchmarks/command_line_interface.py +++ b/src/nwb_benchmarks/command_line_interface.py @@ -6,11 +6,7 @@ import subprocess import sys -from .setup import ( - customize_asv_machine_file, - ensure_machine_info_current, - reduce_results, -) +from .setup import customize_asv_machine_file, reduce_results def main() -> None: @@ -29,22 +25,12 @@ def main() -> None: specific_benchmark_pattern = flags_list[flags_list.index("--bench") + 1] default_asv_machine_file_path = pathlib.Path.home() / ".asv-machine.json" - if command == "setup": - if default_asv_machine_file_path.exists(): - ensure_machine_info_current(file_path=default_asv_machine_file_path) - return - + if command == "run": process = subprocess.Popen(["asv", "machine", "--yes"], stdout=subprocess.PIPE) process.wait() - customize_asv_machine_file(file_path=default_asv_machine_file_path) - elif command == "run": - commit_hash = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).decode("ascii").strip() - if default_asv_machine_file_path.exists(): - ensure_machine_info_current(file_path=default_asv_machine_file_path) - else: - customize_asv_machine_file(file_path=default_asv_machine_file_path) + commit_hash = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).decode("ascii").strip() # Save latest environment list from conda (most thorough) # subprocess tends to have issues inheriting `conda` entrypoint diff --git a/src/nwb_benchmarks/setup/__init__.py b/src/nwb_benchmarks/setup/__init__.py index 97f058f..16c705b 100644 --- a/src/nwb_benchmarks/setup/__init__.py +++ b/src/nwb_benchmarks/setup/__init__.py @@ -1,10 +1,6 @@ """Exposed imports to the `setup` submodule.""" -from ._configure_machine import ( - collect_machine_info, - customize_asv_machine_file, - ensure_machine_info_current, -) +from ._configure_machine import collect_machine_info, customize_asv_machine_file from ._reduce_results import reduce_results -__all__ = ["collect_machine_info", "customize_asv_machine_file", "ensure_machine_info_current", "reduce_results"] +__all__ = ["collect_machine_info", "customize_asv_machine_file", "reduce_results"] diff --git a/src/nwb_benchmarks/setup/_configure_machine.py b/src/nwb_benchmarks/setup/_configure_machine.py index 639bbd8..a52cfb5 100644 --- a/src/nwb_benchmarks/setup/_configure_machine.py +++ b/src/nwb_benchmarks/setup/_configure_machine.py @@ -6,7 +6,6 @@ import pathlib import platform import sys -import warnings from typing import Any, Dict import psutil @@ -90,38 +89,3 @@ def customize_asv_machine_file(file_path: pathlib.Path, overwrite: bool = False) with open(file=file_path, mode="w") as io: json.dump(fp=io, obj=custom_file_info, indent=1) - - -def ensure_machine_info_current(file_path: pathlib.Path): - """ - Even something as simple as adjusting the disk partitions could affect performance. - - If out of date, automatically trigger regeneration of machine info and hash. - Will also likely be affected by ipcfg. - """ - current_machine_info = collect_machine_info() - - # Assume there's only one machine configured per installation - with open(file=file_path, mode="r") as io: - machine_file = json.load(fp=io) - - default_machine_name = next(key for key in machine_file.keys() if key != "version") - machine_info_from_file = machine_file[default_machine_name] - - # Only asserting agains the custom stuff we grab - machine_info_from_file.pop("defaults") - machine_info_from_file.pop("machine") - machine_info_from_file.pop("custom") - - if machine_info_from_file == current_machine_info: - return - - # If debugging is ever necessary in the future, best way I found to summarize differences was - # import unittest - # - # test = unittest.TestCase() - # test.maxDiff = None - # test.assertDictEqual(d1=machine_info_from_file, d2=current_machine_info) - - warnings.warn("The current machine info is out of date! Automatically updating the file.", stacklevel=2) - customize_asv_machine_file(file_path=file_path, overwrite=True)