Skip to content

Commit

Permalink
Fix order of imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dsarmany committed Dec 17, 2024
1 parent 1249cbb commit aa5bc1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion multio/plans/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"""

from . import actions, sinks

from .actions import Aggregation, Encode, Mask, Print, Select, Sink, Statistics, Transport
from .plans import Client, Collection, Plan, Server
from .sinks import FDB, File
24 changes: 12 additions & 12 deletions multio/plans/plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from __future__ import annotations

import os
from typing import Any, Literal, Optional, Union, TypeVar
from typing import Any, Literal, Optional, TypeVar, Union

from pydantic import BaseModel, ConfigDict, Discriminator, Field, Tag, model_serializer, model_validator, validate_call
from typing_extensions import Annotated
Expand All @@ -28,7 +28,7 @@

class MultioBaseModel(BaseModel):
"""Multio Base Model
Should not be instantiated directly, use one of the subclasses instead.
"""

Expand All @@ -50,7 +50,7 @@ def from_yamlfile(cls: T, file: str) -> T:
-------
MultioBaseModel
Loaded BaseModel
"""
"""
return cls.from_yaml(open(file))

@classmethod
Expand All @@ -67,7 +67,7 @@ def from_yaml(cls: T, yaml_str: str) -> T:
-------
MultioBaseModel
Loaded BaseModel
"""
"""
import yaml

return cls.model_validate(yaml.safe_load(yaml_str), strict=True)
Expand Down Expand Up @@ -152,7 +152,7 @@ def add_action(self, action: Actions):
----------
action : Actions
Action class, can be object or dictionary representing action
"""
"""
self.actions.append(action)

@validate_call
Expand All @@ -164,7 +164,7 @@ def extend_actions(self, actions: list[Actions]):
----------
actions : list[Actions]
List of actions to add
"""
"""
self.actions.extend(actions)

def check_validity(self) -> bool:
Expand All @@ -175,7 +175,7 @@ def check_validity(self) -> bool:

def ensure_sink(self) -> "Plan":
"""Ensure that the plan has at least one Sink.
Multio requires a `Sink` in each plan.
"""
if not any([isinstance(action, Sink) for action in self.actions]):
Expand All @@ -190,7 +190,7 @@ def to_client(self) -> Client:
-------
Client
Client Config of this plan
"""
"""
return Client(plans=[self])

def to_server(self) -> Server:
Expand All @@ -201,7 +201,7 @@ def to_server(self) -> Server:
-------
Server
Server Config of this plan
"""
"""
return Server(plans=[self])

def __add__(self, other) -> Client:
Expand Down Expand Up @@ -250,7 +250,7 @@ def add_plan(self, plan: Plan):
----------
plan : Plan
Plan to add, can be object or dictionary representing plan
"""
"""
self.plans.append(plan)

@validate_call
Expand All @@ -269,7 +269,7 @@ def to_server(self) -> Server:
-------
Server
Server Config of these plans
"""
"""
return Server(plans=[self.plans])


Expand Down Expand Up @@ -310,7 +310,7 @@ def add_config(self, key: str, config: CONFIGS):
Name of the config
config : CONFIGS
Config to add
"""
"""
self.configs[key] = config

@validate_call
Expand Down

0 comments on commit aa5bc1c

Please sign in to comment.