From d5d7da16eeac23946224211a8dc649534dc747a6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 12 Feb 2023 20:54:28 -0500 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#1378) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0) - [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.0 → v3.0.0-alpha.2](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.0...v3.0.0-alpha.2) - [github.com/Yelp/detect-secrets: v1.3.0 → v1.4.0](https://github.com/Yelp/detect-secrets/compare/v1.3.0...v1.4.0) * changelog * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0) - [github.com/psf/black: 22.10.0 → 23.1.0](https://github.com/psf/black/compare/22.10.0...23.1.0) - [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](https://github.com/PyCQA/flake8/compare/5.0.4...6.0.0) - [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.2 → v3.0.0-alpha.4](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.2...v3.0.0-alpha.4) - [github.com/hadialqattan/pycln: v2.1.1 → v2.1.3](https://github.com/hadialqattan/pycln/compare/v2.1.1...v2.1.3) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * changelog * boilerplate --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Will Cunningham --- .pre-commit-config.yaml | 10 ++++---- CHANGELOG.md | 4 ++++ covalent/_file_transfer/file_transfer.py | 2 -- .../strategies/rsync_strategy.py | 1 - .../_file_transfer/strategies/s3_strategy.py | 1 - covalent/_results_manager/result.py | 2 -- covalent/_results_manager/results_manager.py | 1 - covalent/_shared_files/config.py | 1 - covalent/_shared_files/utils.py | 1 - covalent/_workflow/depscall.py | 1 - covalent/_workflow/electron.py | 5 ---- covalent/_workflow/lattice.py | 1 - covalent/executor/__init__.py | 2 -- covalent/executor/base.py | 6 ----- .../executor_plugins/remote_executor.py | 1 - covalent_dispatcher/_cli/service.py | 1 - covalent_dispatcher/_core/data_manager.py | 2 -- covalent_dispatcher/_core/dispatcher.py | 3 --- covalent_dispatcher/_core/runner.py | 3 --- covalent_dispatcher/_db/upsert.py | 2 -- covalent_ui/api/v1/data_layer/logs_dal.py | 1 - covalent_ui/api/v1/models/lattices_model.py | 2 -- .../api/v1/routes/end_points/graph_route.py | 1 - covalent_ui/api/v1/utils/file_handle.py | 1 - .../_cli/migrate_test.py | 1 - .../_core/execution_test.py | 1 - .../_core/runner_test.py | 1 - .../covalent_dispatcher_tests/_db/db_test.py | 1 - .../_db/write_result_to_db_test.py | 10 ++++---- .../executor/executor_plugins/local_test.py | 1 - .../strategies/base_strategy_test.py | 21 +++++++++++++++- .../strategies/http_strategy_test.py | 21 +++++++++++++++- .../strategies/rsync_strategy_test.py | 24 +++++++++++++++---- .../strategies/s3_strategy_test.py | 2 -- tests/covalent_tests/workflow/lepton_test.py | 2 -- .../covalent_tests/workflow/transport_test.py | 2 -- .../functional_tests/dask_cluster_cli_test.py | 2 -- tests/functional_tests/dask_executor_test.py | 1 - tests/functional_tests/workflow_stack_test.py | 1 - tests/stress_tests/benchmarks/conftest.py | 20 ++++++++++++++++ .../cpu_intensive_workflows_test.py | 20 ++++++++++++++++ .../memory_intensive_workflow_test.py | 20 ++++++++++++++++ .../benchmarks/parallel_workflows_test.py | 20 ++++++++++++++++ .../benchmarks/two_node_workflows_test.py | 20 ++++++++++++++++ .../benchmarks/vertical_workflows_test.py | 20 ++++++++++++++++ .../stress_tests/scripts/mnist_sublattices.py | 21 +++++++++++++++- tests/stress_tests/scripts/parallel_cpu.py | 20 ++++++++++++++++ tests/stress_tests/scripts/parallel_cpumem.py | 21 +++++++++++++++- tests/stress_tests/scripts/parallel_light.py | 20 ++++++++++++++++ tests/stress_tests/scripts/parallel_mem.py | 20 ++++++++++++++++ tests/stress_tests/scripts/parallel_mixed.py | 21 +++++++++++++++- .../scripts/postprocess_benchmarks.py | 21 +++++++++++++++- tests/stress_tests/scripts/serial_light.py | 20 ++++++++++++++++ .../stress_tests/scripts/squaregraph_light.py | 20 ++++++++++++++++ .../stress_tests/scripts/sublattices_mixed.py | 21 +++++++++++++++- tests/stress_tests/scripts/tasks.py | 20 ++++++++++++++++ tests/stress_tests/stress_test_cpu.py | 20 ++++++++++++++++ tests/stress_tests/stress_test_sublattices.py | 23 +++++++++++++++--- 58 files changed, 454 insertions(+), 80 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f8d3b1f17..760327ef9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ fail_fast: true repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -40,13 +40,13 @@ repos: args: ["--profile", "black"] - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.1.0 hooks: - id: black language_version: python3.8 - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 args: @@ -57,7 +57,7 @@ repos: )$ - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.2 + rev: v3.0.0-alpha.4 hooks: - id: prettier types: [yaml] @@ -66,7 +66,7 @@ repos: meta.yaml| )$ - repo: https://github.com/hadialqattan/pycln - rev: v2.1.1 + rev: v2.1.3 hooks: - id: pycln args: [--config=pyproject.toml] diff --git a/CHANGELOG.md b/CHANGELOG.md index bfbd3ea50..defe7274f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Enhanced the Dockerfile to include builds from various sources and a differentiation between SDK and Server builds +### Operations + +- Updated pre-commit hook versions + ## [0.217.0-rc.0] - 2023-02-12 ### Authors diff --git a/covalent/_file_transfer/file_transfer.py b/covalent/_file_transfer/file_transfer.py index dfcf87783..8e8d4e37c 100644 --- a/covalent/_file_transfer/file_transfer.py +++ b/covalent/_file_transfer/file_transfer.py @@ -45,7 +45,6 @@ def __init__( order: Order = Order.BEFORE, strategy: Optional[FileTransferStrategy] = None, ) -> None: - if isinstance(from_file, str) or from_file is None: from_file = File(from_file) elif not isinstance(from_file, File): @@ -85,7 +84,6 @@ def __init__( ) def cp(self): - file_transfer_call_dep = None return_value_type = FtCallDepReturnValue.FROM_TO diff --git a/covalent/_file_transfer/strategies/rsync_strategy.py b/covalent/_file_transfer/strategies/rsync_strategy.py index 37b1cbb16..f445260c5 100644 --- a/covalent/_file_transfer/strategies/rsync_strategy.py +++ b/covalent/_file_transfer/strategies/rsync_strategy.py @@ -42,7 +42,6 @@ def __init__( host: Optional[str] = "", private_key_path: Optional[str] = None, ): - self.user = user self.private_key_path = private_key_path self.host = host diff --git a/covalent/_file_transfer/strategies/s3_strategy.py b/covalent/_file_transfer/strategies/s3_strategy.py index 9a19b2cad..e49e370f5 100644 --- a/covalent/_file_transfer/strategies/s3_strategy.py +++ b/covalent/_file_transfer/strategies/s3_strategy.py @@ -37,7 +37,6 @@ class S3(FileTransferStrategy): """ def __init__(self, credentials: str = None, profile: str = None, region_name: str = None): - self.credentials = credentials self.profile = profile self.region_name = region_name diff --git a/covalent/_results_manager/result.py b/covalent/_results_manager/result.py index cee43d316..6dc91b4a5 100644 --- a/covalent/_results_manager/result.py +++ b/covalent/_results_manager/result.py @@ -73,7 +73,6 @@ class Result: CANCELLED = RESULT_STATUS.CANCELLED def __init__(self, lattice: Lattice, dispatch_id: str = "") -> None: - self._start_time = None self._end_time = None @@ -306,7 +305,6 @@ def get_all_node_results(self) -> List[Dict]: ] def post_process(self): - # Copied from server-side _post_process() node_outputs = self.get_all_node_outputs() ordered_node_outputs = [] diff --git a/covalent/_results_manager/results_manager.py b/covalent/_results_manager/results_manager.py index 589b0f208..7b23641ad 100644 --- a/covalent/_results_manager/results_manager.py +++ b/covalent/_results_manager/results_manager.py @@ -77,7 +77,6 @@ def _get_result_from_dispatcher( dispatcher_addr: str = None, status_only: bool = False, ) -> Dict: - """ Internal function to get the results of a dispatch from the server without checking if it is ready to read. diff --git a/covalent/_shared_files/config.py b/covalent/_shared_files/config.py index 89eb82e98..1c8ebadcb 100644 --- a/covalent/_shared_files/config.py +++ b/covalent/_shared_files/config.py @@ -40,7 +40,6 @@ class ConfigManager: """ def __init__(self) -> None: - from .defaults import DefaultConfig DEFAULT_CONFIG = asdict(DefaultConfig()) diff --git a/covalent/_shared_files/utils.py b/covalent/_shared_files/utils.py index 051bde145..1d0ff33b1 100644 --- a/covalent/_shared_files/utils.py +++ b/covalent/_shared_files/utils.py @@ -184,7 +184,6 @@ def get_named_params(func, args, kwargs): named_kwargs = {} for ind, parameter_dict in enumerate(ordered_params_dict.items()): - param_name, param = parameter_dict if param.kind in [param.POSITIONAL_ONLY, param.POSITIONAL_OR_KEYWORD]: diff --git a/covalent/_workflow/depscall.py b/covalent/_workflow/depscall.py index 4fa7552b1..f0c7a46c2 100644 --- a/covalent/_workflow/depscall.py +++ b/covalent/_workflow/depscall.py @@ -61,7 +61,6 @@ def __init__( retval_keyword="", override_reserved_retval_keys=False, ): - if not override_reserved_retval_keys and retval_keyword in [RESERVED_RETVAL_KEY__FILES]: raise Exception( f"The retval_keyword for the specified DepsCall uses the reserved value '{retval_keyword}' please re-name to use another return value keyword." diff --git a/covalent/_workflow/electron.py b/covalent/_workflow/electron.py index 8aee091d8..694dc2c8e 100644 --- a/covalent/_workflow/electron.py +++ b/covalent/_workflow/electron.py @@ -156,7 +156,6 @@ def rename(op1: Any, op: str, op2: Any) -> Callable: """ def decorator(f): - op1_name = op1 if hasattr(op1, "function") and op1.function: op1_name = op1.function.__name__ @@ -221,7 +220,6 @@ def __complex__(self): return complex() def __iter__(self): - last_frame = inspect.currentframe().f_back bytecode = last_frame.f_code.co_code expected_unpack_values = bytecode[last_frame.f_lasti + 1] @@ -283,7 +281,6 @@ def get_attr(e, attr): return super().__getattr__(attr) def __getitem__(self, key: Union[int, str]) -> "Electron": - if active_lattice := active_lattice_manager.get_active_lattice(): def get_item(e, key): @@ -317,7 +314,6 @@ def __call__(self, *args, **kwargs) -> Union[Any, "Electron"]: return self.function(*args, **kwargs) if active_lattice.post_processing: - id, output = active_lattice.electron_outputs[0] active_lattice.electron_outputs.pop(0) @@ -447,7 +443,6 @@ def _auto_dict_node(*args, **kwargs): ) else: - encoded_param_value = TransportableObject.make_transportable(param_value) parameter_node = transport_graph.add_node( name=parameter_prefix + str(param_value), diff --git a/covalent/_workflow/lattice.py b/covalent/_workflow/lattice.py index 66e176dbb..12f4e7e5e 100644 --- a/covalent/_workflow/lattice.py +++ b/covalent/_workflow/lattice.py @@ -88,7 +88,6 @@ def __init__( # To be called after build_graph def serialize_to_json(self) -> str: - attributes = deepcopy(self.__dict__) attributes["workflow_function"] = self.workflow_function.to_dict() diff --git a/covalent/executor/__init__.py b/covalent/executor/__init__.py index 96778b9c3..15062a792 100644 --- a/covalent/executor/__init__.py +++ b/covalent/executor/__init__.py @@ -47,7 +47,6 @@ class _ExecutorManager: """ def __init__(self) -> None: - # Dictionary mapping executor name to executor class self.executor_plugins_map: Dict[str, Any] = {} self.executor_plugins_exports_map: Dict[str, Any] = {} @@ -217,7 +216,6 @@ def _load_executors(self, executor_dir: str) -> None: """ if os.path.exists(executor_dir): - module_files = glob.glob(os.path.join(executor_dir, "*.py")) for module_file in module_files: diff --git a/covalent/executor/base.py b/covalent/executor/base.py index 5896bacee..615dd9144 100644 --- a/covalent/executor/base.py +++ b/covalent/executor/base.py @@ -200,7 +200,6 @@ def __init__( *args, **kwargs, ) -> None: - super().__init__(*args, **kwargs) def write_streams_to_file( @@ -243,7 +242,6 @@ async def _execute( results_dir: str, node_id: int = -1, ) -> Any: - loop = asyncio.get_running_loop() return await loop.run_in_executor( None, @@ -371,7 +369,6 @@ def __init__( *args, **kwargs, ) -> None: - super().__init__(*args, **kwargs) async def write_streams_to_file( @@ -381,7 +378,6 @@ async def write_streams_to_file( dispatch_id: str, results_dir: str, ) -> None: - """ Write the contents of stdout and stderr to respective files. @@ -417,7 +413,6 @@ async def _execute( results_dir: str, node_id: int = -1, ) -> Any: - return await self.execute( function, args, @@ -436,7 +431,6 @@ async def execute( results_dir: str, node_id: int = -1, ) -> Any: - self._task_stdout = io.StringIO() self._task_stderr = io.StringIO() diff --git a/covalent/executor/executor_plugins/remote_executor.py b/covalent/executor/executor_plugins/remote_executor.py index 4da04c7a0..3e02a7a1b 100644 --- a/covalent/executor/executor_plugins/remote_executor.py +++ b/covalent/executor/executor_plugins/remote_executor.py @@ -64,7 +64,6 @@ def __init__( credentials_file: str = "", **kwargs, ) -> None: - super().__init__(**kwargs) self.poll_freq = poll_freq diff --git a/covalent_dispatcher/_cli/service.py b/covalent_dispatcher/_cli/service.py index 66ea4fb2a..747278fb3 100644 --- a/covalent_dispatcher/_cli/service.py +++ b/covalent_dispatcher/_cli/service.py @@ -446,7 +446,6 @@ def purge(hard: bool, yes: bool, hell_yeah: bool) -> None: removal_list.add(get_config("dispatcher.db_path")) if not yes: - click.secho(f"{''.join(['*'] * 21)} WARNING {''.join(['*'] * 21)}", fg="yellow") click.echo("Purging will perform the following operations: ") diff --git a/covalent_dispatcher/_core/data_manager.py b/covalent_dispatcher/_core/data_manager.py index 6303aef07..998732bc1 100644 --- a/covalent_dispatcher/_core/data_manager.py +++ b/covalent_dispatcher/_core/data_manager.py @@ -57,7 +57,6 @@ def generate_node_result( sub_dispatch_id=None, sublattice_result=None, ): - return { "node_id": node_id, "start_time": start_time, @@ -138,7 +137,6 @@ def get_unique_id() -> str: def make_dispatch( json_lattice: str, parent_result_object: Result = None, parent_electron_id: int = None ) -> Result: - result_object = initialize_result_object( json_lattice, parent_result_object, parent_electron_id ) diff --git a/covalent_dispatcher/_core/dispatcher.py b/covalent_dispatcher/_core/dispatcher.py index 53df8ff88..00adeb10b 100644 --- a/covalent_dispatcher/_core/dispatcher.py +++ b/covalent_dispatcher/_core/dispatcher.py @@ -57,7 +57,6 @@ def _get_abstract_task_inputs(node_id: int, node_name: str, result_object: Resul abstract_task_input = {"args": [], "kwargs": {}} for parent in result_object.lattice.transport_graph.get_dependencies(node_id): - edge_data = result_object.lattice.transport_graph.get_edge_data(parent, node_id) # value = result_object.lattice.transport_graph.get_node_value(parent, "output") @@ -141,7 +140,6 @@ async def _get_initial_tasks_and_deps(result_object: Result) -> Tuple[int, int, # Domain: dispatcher async def _submit_task(result_object, node_id): - # Get name of the node for the current task node_name = result_object.lattice.transport_graph.get_node_value(node_id, "name") node_status = result_object.lattice.transport_graph.get_node_value(node_id, "status") @@ -177,7 +175,6 @@ async def _submit_task(result_object, node_id): app_log.debug(f"Skipped completed node {node_id}.") else: - # Executor for post_processing and dispatching sublattices pp_executor = result_object.lattice.get_metadata("workflow_executor") pp_executor_data = result_object.lattice.get_metadata("workflow_executor_data") diff --git a/covalent_dispatcher/_core/runner.py b/covalent_dispatcher/_core/runner.py index d1bbc7b61..4bbcecb3b 100644 --- a/covalent_dispatcher/_core/runner.py +++ b/covalent_dispatcher/_core/runner.py @@ -145,7 +145,6 @@ async def _run_abstract_task( selected_executor: Any, workflow_executor: Any, ) -> None: - # Resolve abstract task and inputs to their concrete (serialized) values result_object = datasvc.get_result_object(dispatch_id) timestamp = datetime.now(timezone.utc) @@ -255,7 +254,6 @@ async def _run_task( # run the task on the executor and register any failures try: - if node_name.startswith(sublattice_prefix): sub_electron_id = get_sublattice_electron_id( parent_dispatch_id=dispatch_id, sublattice_node_id=node_id @@ -378,7 +376,6 @@ async def run_abstract_task( selected_executor: Any, workflow_executor: Any, ) -> None: - node_result = await _run_abstract_task( dispatch_id=dispatch_id, node_id=node_id, diff --git a/covalent_dispatcher/_db/upsert.py b/covalent_dispatcher/_db/upsert.py index 8156c6868..214972083 100644 --- a/covalent_dispatcher/_db/upsert.py +++ b/covalent_dispatcher/_db/upsert.py @@ -109,7 +109,6 @@ def _lattice_data(result: Result, electron_id: int = None): (LATTICE_COVA_IMPORTS_FILENAME, result.lattice.cova_imports), (LATTICE_LATTICE_IMPORTS_FILENAME, result.lattice.lattice_imports), ]: - store_file(data_storage_path, filename, data) # Write lattice records to Database @@ -171,7 +170,6 @@ def _electron_data(result: Result): with workflow_db.session() as session: app_log.debug("upsert_electron_data session success") for node_id in dirty_nodes: - results_dir = os.environ.get("COVALENT_DATA_DIR") or get_config( "dispatcher.results_dir" ) diff --git a/covalent_ui/api/v1/data_layer/logs_dal.py b/covalent_ui/api/v1/data_layer/logs_dal.py index a9c0db1cc..4b4dfa424 100644 --- a/covalent_ui/api/v1/data_layer/logs_dal.py +++ b/covalent_ui/api/v1/data_layer/logs_dal.py @@ -58,7 +58,6 @@ def get_logs(self, sort_by, direction, search, count, offset): len_log = len(log) unmatch_str += i if len_log > 0 and ((unmatch_str != "")): - msg = log[len_log - 1]["message"] + "\n" log[len_log - 1]["message"] = msg + unmatch_str unmatch_str = "" diff --git a/covalent_ui/api/v1/models/lattices_model.py b/covalent_ui/api/v1/models/lattices_model.py index fda4b0ca3..780e33aaf 100644 --- a/covalent_ui/api/v1/models/lattices_model.py +++ b/covalent_ui/api/v1/models/lattices_model.py @@ -86,7 +86,6 @@ class LatticeWorkflowExecutorResponse(BaseModel): class GraphNodes(BaseModel): - id: int = None name: str = None node_id: int = None @@ -110,7 +109,6 @@ class GraphNodes(BaseModel): class GraphResponseData(BaseModel): - nodes: List[GraphNodes] = None links: List[dict] = None diff --git a/covalent_ui/api/v1/routes/end_points/graph_route.py b/covalent_ui/api/v1/routes/end_points/graph_route.py index 9cb6fb5c0..b0f0eb183 100644 --- a/covalent_ui/api/v1/routes/end_points/graph_route.py +++ b/covalent_ui/api/v1/routes/end_points/graph_route.py @@ -44,7 +44,6 @@ def get_graph(dispatch_id: uuid.UUID): """ with Session(engine) as session: - graph = Graph(session) graph_data = graph.get_graph(dispatch_id) if graph_data is not None: diff --git a/covalent_ui/api/v1/utils/file_handle.py b/covalent_ui/api/v1/utils/file_handle.py index fd32dad7c..f739fa2f9 100644 --- a/covalent_ui/api/v1/utils/file_handle.py +++ b/covalent_ui/api/v1/utils/file_handle.py @@ -43,7 +43,6 @@ def transportable_object(obj): def validate_data(unpickled_object): - """Validate unpickled object""" if isinstance(unpickled_object, list): if not (unpickled_object): diff --git a/tests/covalent_dispatcher_tests/_cli/migrate_test.py b/tests/covalent_dispatcher_tests/_cli/migrate_test.py index 747f5df8a..1d0106845 100644 --- a/tests/covalent_dispatcher_tests/_cli/migrate_test.py +++ b/tests/covalent_dispatcher_tests/_cli/migrate_test.py @@ -210,7 +210,6 @@ def test_process_transport_graph(): def test_process_transport_graph_is_idempotent(): - ro = get_sample_result_object() tg = ro.lattice.transport_graph tg_new = process_transport_graph(tg) diff --git a/tests/covalent_dispatcher_tests/_core/execution_test.py b/tests/covalent_dispatcher_tests/_core/execution_test.py index 1769c604b..2f67ef86e 100644 --- a/tests/covalent_dispatcher_tests/_core/execution_test.py +++ b/tests/covalent_dispatcher_tests/_core/execution_test.py @@ -419,7 +419,6 @@ def failing_workflow(x): @pytest.mark.asyncio async def test_run_task_sublattice_handling(test_db, mocker): - result_object = get_mock_result() sub_result_object = get_mock_result() sub_result_object._dispatch_id = "sublattice_workflow" diff --git a/tests/covalent_dispatcher_tests/_core/runner_test.py b/tests/covalent_dispatcher_tests/_core/runner_test.py index a3c1155a5..1a253e8f7 100644 --- a/tests/covalent_dispatcher_tests/_core/runner_test.py +++ b/tests/covalent_dispatcher_tests/_core/runner_test.py @@ -163,7 +163,6 @@ async def test_run_task_executor_exception_handling(mocker): @pytest.mark.asyncio async def test_run_task_runtime_exception_handling(mocker): - result_object = get_mock_result() inputs = {"args": [], "kwargs": {}} mock_executor = MagicMock() diff --git a/tests/covalent_dispatcher_tests/_db/db_test.py b/tests/covalent_dispatcher_tests/_db/db_test.py index 9726f32bf..0563cf8e2 100644 --- a/tests/covalent_dispatcher_tests/_db/db_test.py +++ b/tests/covalent_dispatcher_tests/_db/db_test.py @@ -58,7 +58,6 @@ def test_db_path(db: DataStore, tmp_path: Path): def test_default_db_path(db: DataStore, tmp_path: Path, mocker): - DB_PATH = "/tmp/my_db.sqlite" mocker.patch("sqlalchemy.create_engine") diff --git a/tests/covalent_dispatcher_tests/_db/write_result_to_db_test.py b/tests/covalent_dispatcher_tests/_db/write_result_to_db_test.py index 125c1c82c..c8c05c0fd 100644 --- a/tests/covalent_dispatcher_tests/_db/write_result_to_db_test.py +++ b/tests/covalent_dispatcher_tests/_db/write_result_to_db_test.py @@ -392,7 +392,7 @@ def test_insert_electron_dependency_data(test_db, workflow_lattice, mocker): electron_ids = [] cur_time = dt.now(timezone.utc) - for (name, node_id) in [ + for name, node_id in [ ("task_1", 0), (":parameter:1", 1), (":parameter:2", 2), @@ -460,7 +460,7 @@ def test_upsert_electron_dependency_data(test_db, workflow_lattice, mocker): electron_ids = [] cur_time = dt.now(timezone.utc) - for (name, node_id) in [ + for name, node_id in [ ("task_1", 0), (":parameter:1", 1), (":parameter:2", 2), @@ -495,7 +495,7 @@ def test_upsert_electron_dependency_data_idempotent(test_db, workflow_lattice, m electron_ids = [] cur_time = dt.now(timezone.utc) - for (name, node_id) in [ + for name, node_id in [ ("task_1", 0), (":parameter:1", 1), (":parameter:2", 2), @@ -640,7 +640,7 @@ def test_write_sublattice_electron_id(test_db, mocker): # Create electron records. electron_ids = [] cur_time = dt.now(timezone.utc) - for (name, node_id) in [ + for name, node_id in [ ("task_1", 0), (":parameter:1", 1), (":parameter:2", 2), @@ -691,7 +691,7 @@ def test_resolve_electron_id(test_db, mocker): # Create electron records. electron_ids = [] cur_time = dt.now(timezone.utc) - for (name, node_id) in [ + for name, node_id in [ ("task_1", 0), (":parameter:1", 1), (":parameter:2", 2), diff --git a/tests/covalent_tests/executor/executor_plugins/local_test.py b/tests/covalent_tests/executor/executor_plugins/local_test.py index 58dd3f520..b6a773aa4 100644 --- a/tests/covalent_tests/executor/executor_plugins/local_test.py +++ b/tests/covalent_tests/executor/executor_plugins/local_test.py @@ -129,7 +129,6 @@ def local_executor_run_exception_handling__mock_task(x): def test_local_executor_run_exception_handling(mocker): - le = LocalExecutor() le._task_stdout = io.StringIO() le._task_stderr = io.StringIO() diff --git a/tests/covalent_tests/file_transfer/strategies/base_strategy_test.py b/tests/covalent_tests/file_transfer/strategies/base_strategy_test.py index a2a0aaa85..1703737a7 100644 --- a/tests/covalent_tests/file_transfer/strategies/base_strategy_test.py +++ b/tests/covalent_tests/file_transfer/strategies/base_strategy_test.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + from unittest.mock import Mock import pytest @@ -51,7 +71,6 @@ def test_pre_transfer_hook_tmp_file_creation(self, mocker, is_from_temp, is_to_t [(True, True), (True, False), (False, False), (False, True)], ) def test_pre_transfer_hook_return_values(self, mocker, is_from_remote, is_to_remote): - # we do not support remote -> remote operations as of yet if is_from_remote and is_to_remote: return diff --git a/tests/covalent_tests/file_transfer/strategies/http_strategy_test.py b/tests/covalent_tests/file_transfer/strategies/http_strategy_test.py index f828f769b..5ef8bd8a9 100644 --- a/tests/covalent_tests/file_transfer/strategies/http_strategy_test.py +++ b/tests/covalent_tests/file_transfer/strategies/http_strategy_test.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import pytest from covalent._file_transfer import File @@ -5,7 +25,6 @@ class TestHTTPStrategy: - MOCK_LOCAL_FILEPATH = "/Users/user/data.csv" MOCK_REMOTE_FILEPATH = "http://example.com/data.csv" diff --git a/tests/covalent_tests/file_transfer/strategies/rsync_strategy_test.py b/tests/covalent_tests/file_transfer/strategies/rsync_strategy_test.py index d4c59d2d7..d1cb035c4 100644 --- a/tests/covalent_tests/file_transfer/strategies/rsync_strategy_test.py +++ b/tests/covalent_tests/file_transfer/strategies/rsync_strategy_test.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + from subprocess import CalledProcessError from unittest.mock import Mock @@ -8,7 +28,6 @@ class TestRsyncStrategy: - MOCK_HOST = "11.11.11.11" MOCK_USER = "admin" MOCK_LOCAL_FILEPATH = "/Users/user/data.csv" @@ -24,7 +43,6 @@ class TestRsyncStrategy: ], ) def test_upload_download_success(self, operation, mocker): - # validate subprocess created by instantiating Popen MOCK_CMD = "rsync ..." @@ -62,7 +80,6 @@ def test_upload_download_success(self, operation, mocker): ], ) def test_upload_download_cp_failure(self, operation, mocker): - # if subprocess returns with return code 1 raise a CalledProcessError exception MOCK_CMD = "rsync ..." @@ -99,7 +116,6 @@ def test_get_rsync_cmd(self): assert cp_cmd == "rsync -a /home/ubuntu/from.csv /home/ubuntu/to.csv" def test_get_ssh_rsync_cmd_with_ssh_key(self, mocker): - mocker.patch("os.path.exists", return_value=True) local_file = File(self.MOCK_LOCAL_FILEPATH) diff --git a/tests/covalent_tests/file_transfer/strategies/s3_strategy_test.py b/tests/covalent_tests/file_transfer/strategies/s3_strategy_test.py index 5306a83f4..d0799c963 100644 --- a/tests/covalent_tests/file_transfer/strategies/s3_strategy_test.py +++ b/tests/covalent_tests/file_transfer/strategies/s3_strategy_test.py @@ -29,7 +29,6 @@ class TestS3Strategy: - MOCK_LOCAL_FILEPATH = "/Users/user/data.csv" MOCK_REMOTE_FILEPATH = "s3://covalent-tmp/data.csv" MOCK_AWS_CREDENTIALS = "~/.aws/credentials" @@ -45,7 +44,6 @@ def MOCK_STRATEGY_CONFIG(self): } def test_init(self, mocker): - boto3_mock = MagicMock() sys.modules["boto3"] = boto3_mock boto3_client_mock = mocker.patch("boto3.client") diff --git a/tests/covalent_tests/workflow/lepton_test.py b/tests/covalent_tests/workflow/lepton_test.py index 698d5a235..fff93359a 100644 --- a/tests/covalent_tests/workflow/lepton_test.py +++ b/tests/covalent_tests/workflow/lepton_test.py @@ -479,7 +479,6 @@ def test_shell_wrapper( kwargs, valid, ): - if library_name: with open(library_name, "w") as f: f.write(library_body) @@ -511,7 +510,6 @@ def test_shell_wrapper( def test_lepton_constructor_serializes_metadata(): - le = LocalExecutor() bashdep = DepsBash(["yum install gcc"]) lep = Lepton( diff --git a/tests/covalent_tests/workflow/transport_test.py b/tests/covalent_tests/workflow/transport_test.py index c99f363a0..89af46817 100644 --- a/tests/covalent_tests/workflow/transport_test.py +++ b/tests/covalent_tests/workflow/transport_test.py @@ -179,7 +179,6 @@ def test_transportable_object_serialize_deserialize(transportable_object): def test_transportable_object_deserialize_list(transportable_object): - deserialized = [1, 2, {"a": 3, "b": [4, 5]}] serialized_list = [ TransportableObject.make_transportable(1), @@ -197,7 +196,6 @@ def test_transportable_object_deserialize_list(transportable_object): def test_transportable_object_deserialize_dict(transportable_object): - deserialized = {"a": 1, "b": [2, {"c": 3}]} serialized_dict = { "a": TransportableObject.make_transportable(1), diff --git a/tests/functional_tests/dask_cluster_cli_test.py b/tests/functional_tests/dask_cluster_cli_test.py index a79064c7c..bfebb7276 100644 --- a/tests/functional_tests/dask_cluster_cli_test.py +++ b/tests/functional_tests/dask_cluster_cli_test.py @@ -182,7 +182,6 @@ async def test_cluster_scale_up_down(admin_worker_addr, event_loop): target_cluster_size = DEFAULT_N_WORKERS + 1 with contextlib.suppress(TimeoutError): - await _cluster_scale(admin_worker_addr, target_cluster_size) # Having to wait here for the time it takes to create a new dask worker @@ -192,7 +191,6 @@ async def test_cluster_scale_up_down(admin_worker_addr, event_loop): assert cluster_size == target_cluster_size with contextlib.suppress(TimeoutError): - # Scale cluster back down await _cluster_scale(admin_worker_addr, DEFAULT_N_WORKERS) diff --git a/tests/functional_tests/dask_executor_test.py b/tests/functional_tests/dask_executor_test.py index 37aea360f..4720c9ac7 100644 --- a/tests/functional_tests/dask_executor_test.py +++ b/tests/functional_tests/dask_executor_test.py @@ -26,7 +26,6 @@ def start_dask_cluster(): - from dask.distributed import LocalCluster cluster = LocalCluster() diff --git a/tests/functional_tests/workflow_stack_test.py b/tests/functional_tests/workflow_stack_test.py index 6853f2f4f..31c55a107 100644 --- a/tests/functional_tests/workflow_stack_test.py +++ b/tests/functional_tests/workflow_stack_test.py @@ -317,7 +317,6 @@ def workflow(): def test_electron_deps_pip(): - import subprocess @ct.electron(deps_pip=ct.DepsPip(packages=["pydash==5.1.0"])) diff --git a/tests/stress_tests/benchmarks/conftest.py b/tests/stress_tests/benchmarks/conftest.py index 37cb40dad..f42414f5a 100644 --- a/tests/stress_tests/benchmarks/conftest.py +++ b/tests/stress_tests/benchmarks/conftest.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import logging import time diff --git a/tests/stress_tests/benchmarks/cpu_intensive_workflows_test.py b/tests/stress_tests/benchmarks/cpu_intensive_workflows_test.py index bed0d6d3f..c8757039e 100644 --- a/tests/stress_tests/benchmarks/cpu_intensive_workflows_test.py +++ b/tests/stress_tests/benchmarks/cpu_intensive_workflows_test.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import random import pytest diff --git a/tests/stress_tests/benchmarks/memory_intensive_workflow_test.py b/tests/stress_tests/benchmarks/memory_intensive_workflow_test.py index 34415f1d2..4cfd152b6 100644 --- a/tests/stress_tests/benchmarks/memory_intensive_workflow_test.py +++ b/tests/stress_tests/benchmarks/memory_intensive_workflow_test.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import numpy as np import pytest diff --git a/tests/stress_tests/benchmarks/parallel_workflows_test.py b/tests/stress_tests/benchmarks/parallel_workflows_test.py index c7b71dd6a..bd67dbdeb 100644 --- a/tests/stress_tests/benchmarks/parallel_workflows_test.py +++ b/tests/stress_tests/benchmarks/parallel_workflows_test.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import secrets import tempfile diff --git a/tests/stress_tests/benchmarks/two_node_workflows_test.py b/tests/stress_tests/benchmarks/two_node_workflows_test.py index 2799cb120..fa395bf78 100644 --- a/tests/stress_tests/benchmarks/two_node_workflows_test.py +++ b/tests/stress_tests/benchmarks/two_node_workflows_test.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import pytest import covalent as ct diff --git a/tests/stress_tests/benchmarks/vertical_workflows_test.py b/tests/stress_tests/benchmarks/vertical_workflows_test.py index 2e26700ba..6db399e56 100644 --- a/tests/stress_tests/benchmarks/vertical_workflows_test.py +++ b/tests/stress_tests/benchmarks/vertical_workflows_test.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import pytest import covalent as ct diff --git a/tests/stress_tests/scripts/mnist_sublattices.py b/tests/stress_tests/scripts/mnist_sublattices.py index 887e0d9e7..57c76f91d 100644 --- a/tests/stress_tests/scripts/mnist_sublattices.py +++ b/tests/stress_tests/scripts/mnist_sublattices.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Run MNIST workflows in parallel sublattices # Adapted from MNIST covalent tutorial @@ -249,7 +269,6 @@ def feedforward_workflow(tasks, predecessors): # With covalent for w in widths: - tasks = [[nn_workflow for i in range(w)]] deps = [] diff --git a/tests/stress_tests/scripts/parallel_cpu.py b/tests/stress_tests/scripts/parallel_cpu.py index d9f0d1108..2f09728fc 100644 --- a/tests/stress_tests/scripts/parallel_cpu.py +++ b/tests/stress_tests/scripts/parallel_cpu.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Workflow with multiple independent cpu_intensive electrons # Transport graph looks like # e e e ... diff --git a/tests/stress_tests/scripts/parallel_cpumem.py b/tests/stress_tests/scripts/parallel_cpumem.py index 236b5fc04..480331d67 100644 --- a/tests/stress_tests/scripts/parallel_cpumem.py +++ b/tests/stress_tests/scripts/parallel_cpumem.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Workflow with both cpu and mem intensive tasks, all independent # Graph looks like # e e e ... @@ -113,7 +133,6 @@ def feedforward_workflow(tasks, predecessors): # With covalent for w in widths: - tasks = [[sample_cpu_task for i in range(w)]] for i in range(int(w / 2), w): tasks[0][i] = sample_mem_task diff --git a/tests/stress_tests/scripts/parallel_light.py b/tests/stress_tests/scripts/parallel_light.py index c21560ba8..8527de5e7 100644 --- a/tests/stress_tests/scripts/parallel_light.py +++ b/tests/stress_tests/scripts/parallel_light.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Workflow with independent lightweight electrons # Transport graph consists of a single layer # e e e ... diff --git a/tests/stress_tests/scripts/parallel_mem.py b/tests/stress_tests/scripts/parallel_mem.py index 28819f74c..1b698640b 100644 --- a/tests/stress_tests/scripts/parallel_mem.py +++ b/tests/stress_tests/scripts/parallel_mem.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Workflow with independent memory_intensive electrons # Transport graph consists of a single layer # e e e ... diff --git a/tests/stress_tests/scripts/parallel_mixed.py b/tests/stress_tests/scripts/parallel_mixed.py index 3c3a26990..06d30b84f 100644 --- a/tests/stress_tests/scripts/parallel_mixed.py +++ b/tests/stress_tests/scripts/parallel_mixed.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Workflow with both cpu-heavy and cpu-light electrons # Transport graph consists of a single layer # e e e ... @@ -114,7 +134,6 @@ def feedforward_workflow(tasks, predecessors): # With covalent for w in widths: - tasks = [[sample_task for i in range(w)]] tasks[0][0] = sample_cpu_task diff --git a/tests/stress_tests/scripts/postprocess_benchmarks.py b/tests/stress_tests/scripts/postprocess_benchmarks.py index ab225cccb..4a1516879 100644 --- a/tests/stress_tests/scripts/postprocess_benchmarks.py +++ b/tests/stress_tests/scripts/postprocess_benchmarks.py @@ -1,4 +1,24 @@ #!/usr/bin/env python +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # coding: utf-8 # In[3]: @@ -16,7 +36,6 @@ benchmarks = os.listdir("benchmark_results") for benchmark_name in benchmarks: - benchmark_dir = Path("benchmark_results") / benchmark_name ct_results = [] noct_results = [] diff --git a/tests/stress_tests/scripts/serial_light.py b/tests/stress_tests/scripts/serial_light.py index b996359b3..6e1b07451 100644 --- a/tests/stress_tests/scripts/serial_light.py +++ b/tests/stress_tests/scripts/serial_light.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Workflow with a single chain of lightweight tasks # Graph consists of a single chain # e diff --git a/tests/stress_tests/scripts/squaregraph_light.py b/tests/stress_tests/scripts/squaregraph_light.py index 48c53c6bc..7cbbb87a6 100644 --- a/tests/stress_tests/scripts/squaregraph_light.py +++ b/tests/stress_tests/scripts/squaregraph_light.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Workflow with a large graph, all lightweight electrons # Transport graph looks like a feedforward neural network # comprising of fully-connected layers. diff --git a/tests/stress_tests/scripts/sublattices_mixed.py b/tests/stress_tests/scripts/sublattices_mixed.py index 5feb7e812..728b0ed71 100644 --- a/tests/stress_tests/scripts/sublattices_mixed.py +++ b/tests/stress_tests/scripts/sublattices_mixed.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + # Workflow consisting of one MNIST sublattice and multiple # cpu-intensive tasks, all independent. @@ -268,7 +288,6 @@ def feedforward_workflow(tasks, predecessors): # With covalent for w in widths: - tasks = [[sample_cpu_task for i in range(w)]] tasks[0][0] = nn_workflow diff --git a/tests/stress_tests/scripts/tasks.py b/tests/stress_tests/scripts/tasks.py index 5c4cc8868..080b68dcc 100644 --- a/tests/stress_tests/scripts/tasks.py +++ b/tests/stress_tests/scripts/tasks.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import math from pathlib import Path from typing import Tuple diff --git a/tests/stress_tests/stress_test_cpu.py b/tests/stress_tests/stress_test_cpu.py index 4ee95fc57..c260e974c 100644 --- a/tests/stress_tests/stress_test_cpu.py +++ b/tests/stress_tests/stress_test_cpu.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import covalent as ct N = 8 diff --git a/tests/stress_tests/stress_test_sublattices.py b/tests/stress_tests/stress_test_sublattices.py index 9194f521a..475f81b47 100644 --- a/tests/stress_tests/stress_test_sublattices.py +++ b/tests/stress_tests/stress_test_sublattices.py @@ -1,3 +1,23 @@ +# Copyright 2021 Agnostiq Inc. +# +# This file is part of Covalent. +# +# Licensed under the GNU Affero General Public License 3.0 (the "License"). +# A copy of the License may be obtained with this software package or at +# +# https://www.gnu.org/licenses/agpl-3.0.en.html +# +# Use of this file is prohibited except in compliance with the License. Any +# modifications or derivative works of this file must retain this copyright +# notice, and modified files must contain a notice indicating that they have +# been altered from the originals. +# +# Covalent is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. +# +# Relief from the License may be granted by purchasing a commercial license. + import numpy as np import covalent as ct @@ -9,7 +29,6 @@ @ct.electron def matrix_workload(mat_1, mat_2, stall=STALL, x=X): - i = 0 while i < stall: x * x @@ -61,7 +80,6 @@ def deflate(mat_1, dim=3): @ct.electron @ct.lattice def idi(mat_1): - mat_2 = inflate(mat_1) mat_3, mat_4 = deflate(mat_2) mat_5 = inflate(mat_3) @@ -71,7 +89,6 @@ def idi(mat_1): @ct.lattice def workflow(dim=3): - mat_1 = np.random.default_rng().integers(10, size=(dim, dim)) mat_2, mat_3 = split_in_half(mat_1)