Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1378)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.8.0 → 22.10.0](psf/black@22.8.0...22.10.0)
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.0 → v3.0.0-alpha.2](pre-commit/mirrors-prettier@v3.0.0-alpha.0...v3.0.0-alpha.2)
- [github.com/Yelp/detect-secrets: v1.3.0 → v1.4.0](Yelp/detect-secrets@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](pre-commit/pre-commit-hooks@v4.3.0...v4.4.0)
- [github.com/psf/black: 22.10.0 → 23.1.0](psf/black@22.10.0...23.1.0)
- [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](PyCQA/flake8@5.0.4...6.0.0)
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.2 → v3.0.0-alpha.4](pre-commit/mirrors-prettier@v3.0.0-alpha.2...v3.0.0-alpha.4)
- [github.com/hadialqattan/pycln: v2.1.1 → v2.1.3](hadialqattan/pycln@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 <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and wjcunningham7 authored Feb 13, 2023
1 parent 7acfa45 commit d5d7da1
Show file tree
Hide file tree
Showing 58 changed files with 454 additions and 80 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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]
Expand All @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions covalent/_file_transfer/file_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -85,7 +84,6 @@ def __init__(
)

def cp(self):

file_transfer_call_dep = None
return_value_type = FtCallDepReturnValue.FROM_TO

Expand Down
1 change: 0 additions & 1 deletion covalent/_file_transfer/strategies/rsync_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion covalent/_file_transfer/strategies/s3_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions covalent/_results_manager/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = []
Expand Down
1 change: 0 additions & 1 deletion covalent/_results_manager/results_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion covalent/_shared_files/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class ConfigManager:
"""

def __init__(self) -> None:

from .defaults import DefaultConfig

DEFAULT_CONFIG = asdict(DefaultConfig())
Expand Down
1 change: 0 additions & 1 deletion covalent/_shared_files/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
1 change: 0 additions & 1 deletion covalent/_workflow/depscall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
5 changes: 0 additions & 5 deletions covalent/_workflow/electron.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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),
Expand Down
1 change: 0 additions & 1 deletion covalent/_workflow/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 0 additions & 2 deletions covalent/executor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {}
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 0 additions & 6 deletions covalent/executor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ def __init__(
*args,
**kwargs,
) -> None:

super().__init__(*args, **kwargs)

def write_streams_to_file(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -371,7 +369,6 @@ def __init__(
*args,
**kwargs,
) -> None:

super().__init__(*args, **kwargs)

async def write_streams_to_file(
Expand All @@ -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.
Expand Down Expand Up @@ -417,7 +413,6 @@ async def _execute(
results_dir: str,
node_id: int = -1,
) -> Any:

return await self.execute(
function,
args,
Expand All @@ -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()

Expand Down
1 change: 0 additions & 1 deletion covalent/executor/executor_plugins/remote_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def __init__(
credentials_file: str = "",
**kwargs,
) -> None:

super().__init__(**kwargs)

self.poll_freq = poll_freq
Expand Down
1 change: 0 additions & 1 deletion covalent_dispatcher/_cli/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: ")
Expand Down
2 changes: 0 additions & 2 deletions covalent_dispatcher/_core/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def generate_node_result(
sub_dispatch_id=None,
sublattice_result=None,
):

return {
"node_id": node_id,
"start_time": start_time,
Expand Down Expand Up @@ -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
)
Expand Down
3 changes: 0 additions & 3 deletions covalent_dispatcher/_core/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
3 changes: 0 additions & 3 deletions covalent_dispatcher/_core/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions covalent_dispatcher/_db/upsert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
)
Expand Down
1 change: 0 additions & 1 deletion covalent_ui/api/v1/data_layer/logs_dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
2 changes: 0 additions & 2 deletions covalent_ui/api/v1/models/lattices_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class LatticeWorkflowExecutorResponse(BaseModel):


class GraphNodes(BaseModel):

id: int = None
name: str = None
node_id: int = None
Expand All @@ -110,7 +109,6 @@ class GraphNodes(BaseModel):


class GraphResponseData(BaseModel):

nodes: List[GraphNodes] = None
links: List[dict] = None

Expand Down
1 change: 0 additions & 1 deletion covalent_ui/api/v1/routes/end_points/graph_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion covalent_ui/api/v1/utils/file_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion tests/covalent_dispatcher_tests/_cli/migrate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tests/covalent_dispatcher_tests/_core/execution_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit d5d7da1

Please sign in to comment.