Coder Social home page Coder Social logo

fairtracks / omnipy Goto Github PK

View Code? Open in Web Editor NEW
14.0 9.0 1.0 2.12 MB

Omnipy is a high level Python library for type-driven data wrangling and scalable workflow orchestration (under development)

Home Page: http://omnipy.readthedocs.io/

License: Apache License 2.0

Python 100.00%
data-wrangling etl metadata prefect research-data fair json ontologies pydantic tabular

omnipy's Issues

change model type to params: Union[Type[Any], Tuple[Type[Any], ...]]

as in GenericModel

# TODO: change model type to params: Union[Type[Any], Tuple[Type[Any], ...]]

        del cls.__annotations__[ROOT_KEY]

    def __class_getitem__(cls, model: Union[Type[RootT], TypeVar]) -> Union[Type[RootT], TypeVar]:
        # TODO: change model type to params: Union[Type[Any], Tuple[Type[Any], ...]]
        #       as in GenericModel

        # For now, only singular model types are allowed. These lines are needed for

implement general solution to make sure that one does not modify input data by

automatically copying or otherwise. Perhaps setting immutable/frozen option in pydantic,

if available?

# TODO: implement general solution to make sure that one does not modify input data by

@TaskTemplate()
def remove_columns(json_dataset: JsonListOfDictsOfAnyDataset,
                   column_keys_for_data_items: Dict[str, List[str]]) -> JsonListOfDictsOfAnyDataset:
    # TODO: implement general solution to make sure that one does not modify input data by
    #       automatically copying or otherwise. Perhaps setting immutable/frozen option in pydantic,
    #       if available?
    #

switch from plural to singular for names of modules in omnipy modules

# TODO: switch from plural to singular for names of modules in omnipy modules

                                        JsonModel,
                                        JsonNestedDictsModel)

# TODO: switch from plural to singular for names of modules in omnipy modules
# TODO: call omnipy modules something else than modules, to distinguish from Python modules.
#       Perhaps plugins?

JsonModelT = TypeVar('JsonModelT', bound=Union[JsonModel, JsonListModel, JsonDictModel])

Refactor

        datetime_str = run_time.strftime('%Y_%m_%d-%H_%M_%S')
        return datetime_str

    # TODO: Refactor
    def _deserialize_and_restore_outputs(self) -> Dataset:
        output_path = Path(self.config.persist_data_dir_path)
        if os.path.exists(output_path):

Check if we can move to explicit definition of __root__ field at the object

level in pydantic 2.0 (when it is released)

# TODO: Check if we can move to explicit definition of __root__ field at the object

        # As long as models are not created concurrently, setting the class members temporarily
        # should not have averse effects
        # TODO: Check if we can move to explicit definition of __root__ field at the object
        #       level in pydantic 2.0 (when it is released)
        if cls == Model:
            cls._depopulate_root_field()

Refactor to remove dependency

Also, add test for not allowing override of fixed_params

# TODO: Refactor to remove dependency

                    param_keys = set(inspect.signature(job).parameters.keys())

                    # TODO: Refactor to remove dependency
                    #       Also, add test for not allowing override of fixed_params
                    if hasattr(job, 'param_key_map'):
                        for key, val in job.param_key_map.items():

Possibly reimplement logic using a state machine, e.g. "transitions" package

# TODO: Possibly reimplement logic using a state machine, e.g. "transitions" package

                 persist_outputs: Optional[PersistOutputsOptions] = None,
                 restore_outputs: Optional[RestoreOutputsOptions] = None):

        # TODO: Possibly reimplement logic using a state machine, e.g. "transitions" package
        if persist_outputs is None:
            self._persist_outputs = PersistOpts.FOLLOW_CONFIG if self._has_job_config else None
        else:

Add test for get_model_class

# TODO: Add test for get_model_class

        if not self.__doc__:
            self._set_standard_field_description()

    # TODO: Add test for get_model_class

    def get_model_class(self) -> ModelT:
        return self.__fields__.get(DATA_KEY).type_

    # TODO: Update _raise_no_model_exception() text. Model is now a requirement

    @staticmethod
    def _raise_no_model_exception() -> None:

refactor using state machine

# TODO: refactor using state machine

    def __init__(self, *args: object, name: Optional[str] = None, **kwargs: object):
        # super().__init__()

        # TODO: refactor using state machine

        if not isinstance(self, JobTemplate) and not isinstance(self, Job):
            raise JobStateException('JobBase and subclasses not inheriting from JobTemplate '

when parsing config from file is implemented, make sure that the new engine

config classes here reparse the config files

# TODO: when parsing config from file is implemented, make sure that the new engine

        return getattr(self.objects, engine_choice)

    def _new_engine_config_if_new_cls(self, engine: IsEngine, engine_choice: EngineChoice) -> None:
        # TODO: when parsing config from file is implemented, make sure that the new engine
        #       config classes here reparse the config files
        engine_config_cls = engine.get_config_cls()
        if self._get_engine_config(engine_choice).__class__ is not engine_config_cls:

call omnipy modules something else than modules, to distinguish from Python modu...

Perhaps plugins?

# TODO: call omnipy modules something else than modules, to distinguish from Python modules.

                                        JsonModel,
                                        JsonNestedDictsModel)

# TODO: switch from plural to singular for names of modules in omnipy modules
# TODO: call omnipy modules something else than modules, to distinguish from Python modules.
#       Perhaps plugins?

JsonModelT = TypeVar('JsonModelT', bound=Union[JsonModel, JsonListModel, JsonDictModel])

Reimplement logic using a state machine, e.g. "transitions" package

# TODO: Reimplement logic using a state machine, e.g. "transitions" package

        return bool(other_job_same_unique_name) and id(other_job_same_unique_name) != id(job)

    def _update_job_registration(self, job: IsJob, state: RunState) -> None:
        # TODO: Reimplement logic using a state machine, e.g. "transitions" package
        if self._other_job_registered_with_same_unique_name(job):
            while self._other_job_registered_with_same_unique_name(job):
                job.regenerate_unique_name()

Update _raise_no_model_exception() text. Model is now a requirement

# TODO: Update _raise_no_model_exception() text. Model is now a requirement

        if not self.__doc__:
            self._set_standard_field_description()

    # TODO: Add test for get_model_class

    def get_model_class(self) -> ModelT:
        return self.__fields__.get(DATA_KEY).type_

    # TODO: Update _raise_no_model_exception() text. Model is now a requirement

    @staticmethod
    def _raise_no_model_exception() -> None:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.