Skip to content

Commit

Permalink
Misc comments and TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinugu committed Jun 17, 2024
1 parent 4a5072a commit d3d3037
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 253 deletions.
2 changes: 0 additions & 2 deletions src/omnipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__version__ = '0.15.12'

import os
import typing

from omnipy.compute.flow import (DagFlow,
DagFlowTemplate,
Expand Down Expand Up @@ -138,7 +137,6 @@
transpose_columns_with_data_files)

# if typing.TYPE_CHECKING:
# if True:

ROOT_DIR = os.path.dirname(os.path.abspath(__file__))

Expand Down
15 changes: 14 additions & 1 deletion src/omnipy/_dynamic_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,26 @@

from pydantic.utils import lenient_isinstance, lenient_issubclass

# TODO: Finish implementation of dynamic __all__ generation. Possibly useful together with Poe the
# Poet (https://poethepoet.natn.io/poetry_plugin.html) for generating a fixed __all__ list as
# part of the build process. The goal for this functionality is to follow DRY principles and
# make sure new datasets, models, and jobs are exported. It is important to also allow export
# under development, either through running `poetry build` or through a
# `if not typing.TYPE_CHECKING` block or similar solution to allow dynamic __all__ generation
# for development (with omnipy imported through `pip install -e {PATH_TO_OMNIPY}`). The exact
# implementation is not yet decided, but the goal is to make the code the single source of
# truth for the exported elements of omnipy.

ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
__all__: list[str] = []

_all_element_names: set[str] = set()

_exclude_modules: set[str] = {
'_dynamic_all', 'modules.frozen', 'modules.fairtracks', 'util.tabulate'
'_dynamic_all',
'modules.frozen', # Recursive frozen models crashes mypy v1.10 + waiting for pydantic support
'modules.fairtracks',
'util.tabulate',
}
_exclude_attrs: set[str] = {'JobMixin', 'JobTemplateMixin'}

Expand Down
250 changes: 0 additions & 250 deletions src/omnipy/_export.py

This file was deleted.

5 changes: 5 additions & 0 deletions src/omnipy/modules/frozen/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
# Note: see comments in omnipy.modules.json.models for more information on the basic organisation of
# nested models.

# Note 2: currently crashes mypy (v1.10), probably due to recursive type aliases combined with
# TypeVars from typing_extensions (with default). Not urgent to fix, as this in any case
# awaits pydantic 2 and issue 6868 to be resolved. Keep out of __all__ until mypy issue
# is fixed in order to avoid crashes with pytest-mypy-plugins, e.g. "test_json_types.yml".

#
# Private models
#
Expand Down

0 comments on commit d3d3037

Please sign in to comment.