From c48ea8c5c80abf030fe8863b631fc2fcdcc8df3c Mon Sep 17 00:00:00 2001 From: Sveinung Gundersen Date: Sun, 22 Oct 2023 01:28:53 +0200 Subject: [PATCH] Misc doc files (do we need this?) --- docs/mkdocs_site/404.html | 2216 ++++++ docs/mkdocs_site/assets/_mkdocstrings.css | 36 + docs/mkdocs_site/assets/images/favicon.png | Bin 0 -> 1870 bytes .../assets/javascripts/bundle.b4d07000.min.js | 29 + .../javascripts/bundle.b4d07000.min.js.map | 8 + .../javascripts/lunr/min/lunr.ar.min.js | 1 + .../javascripts/lunr/min/lunr.da.min.js | 18 + .../javascripts/lunr/min/lunr.de.min.js | 18 + .../javascripts/lunr/min/lunr.du.min.js | 18 + .../javascripts/lunr/min/lunr.es.min.js | 18 + .../javascripts/lunr/min/lunr.fi.min.js | 18 + .../javascripts/lunr/min/lunr.fr.min.js | 18 + .../javascripts/lunr/min/lunr.hi.min.js | 1 + .../javascripts/lunr/min/lunr.hu.min.js | 18 + .../javascripts/lunr/min/lunr.hy.min.js | 1 + .../javascripts/lunr/min/lunr.it.min.js | 18 + .../javascripts/lunr/min/lunr.ja.min.js | 1 + .../javascripts/lunr/min/lunr.jp.min.js | 1 + .../javascripts/lunr/min/lunr.kn.min.js | 1 + .../javascripts/lunr/min/lunr.ko.min.js | 1 + .../javascripts/lunr/min/lunr.multi.min.js | 1 + .../javascripts/lunr/min/lunr.nl.min.js | 18 + .../javascripts/lunr/min/lunr.no.min.js | 18 + .../javascripts/lunr/min/lunr.pt.min.js | 18 + .../javascripts/lunr/min/lunr.ro.min.js | 18 + .../javascripts/lunr/min/lunr.ru.min.js | 18 + .../javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + .../javascripts/lunr/min/lunr.sv.min.js | 18 + .../javascripts/lunr/min/lunr.ta.min.js | 1 + .../javascripts/lunr/min/lunr.te.min.js | 1 + .../javascripts/lunr/min/lunr.th.min.js | 1 + .../javascripts/lunr/min/lunr.tr.min.js | 18 + .../javascripts/lunr/min/lunr.vi.min.js | 1 + .../javascripts/lunr/min/lunr.zh.min.js | 1 + .../assets/javascripts/lunr/tinyseg.js | 206 + .../assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.208ed371.min.js | 42 + .../workers/search.208ed371.min.js.map | 8 + .../assets/stylesheets/main.85bb2934.min.css | 1 + .../stylesheets/main.85bb2934.min.css.map | 1 + .../stylesheets/palette.a6bdf11c.min.css | 1 + .../stylesheets/palette.a6bdf11c.min.css.map | 1 + docs/mkdocs_site/gen_ref_pages.py | 53 + docs/mkdocs_site/index.html | 3589 +++++++++ docs/mkdocs_site/objects.inv | Bin 0 -> 5598 bytes docs/mkdocs_site/reference/SUMMARY/index.html | 2368 ++++++ .../reference/omnipy/api/enums/index.html | 3548 +++++++++ .../omnipy/api/exceptions/index.html | 2360 ++++++ .../reference/omnipy/api/index.html | 2280 ++++++ .../reference/omnipy/api/protocols/index.html | 2282 ++++++ .../api/protocols/private/compute/index.html | 2286 ++++++ .../protocols/private/compute/job/index.html | 4569 +++++++++++ .../private/compute/job_creator/index.html | 2715 +++++++ .../private/compute/mixins/index.html | 2719 +++++++ .../api/protocols/private/config/index.html | 2499 ++++++ .../api/protocols/private/engine/index.html | 2621 +++++++ .../omnipy/api/protocols/private/index.html | 2284 ++++++ .../api/protocols/private/log/index.html | 2762 +++++++ .../api/protocols/private/util/index.html | 2553 +++++++ .../api/protocols/public/compute/index.html | 2917 +++++++ .../api/protocols/public/config/index.html | 2912 +++++++ .../api/protocols/public/engine/index.html | 2805 +++++++ .../api/protocols/public/hub/index.html | 3478 +++++++++ .../omnipy/api/protocols/public/index.html | 2284 ++++++ .../reference/omnipy/api/types/index.html | 2614 +++++++ .../reference/omnipy/compute/flow/index.html | 2903 +++++++ .../omnipy/compute/func_job/index.html | 2549 +++++++ .../reference/omnipy/compute/index.html | 2280 ++++++ .../reference/omnipy/compute/job/index.html | 3608 +++++++++ .../omnipy/compute/job_creator/index.html | 2954 ++++++++ .../compute/mixins/flow_context/index.html | 2533 +++++++ .../compute/mixins/func_signature/index.html | 2629 +++++++ .../omnipy/compute/mixins/index.html | 2282 ++++++ .../omnipy/compute/mixins/iterate/index.html | 2624 +++++++ .../compute/mixins/mixin_types/index.html | 2721 +++++++ .../omnipy/compute/mixins/name/index.html | 2695 +++++++ .../omnipy/compute/mixins/params/index.html | 2629 +++++++ .../compute/mixins/result_key/index.html | 2506 ++++++ .../compute/mixins/serialize/index.html | 3081 ++++++++ .../reference/omnipy/compute/task/index.html | 2543 +++++++ .../omnipy/compute/tasklist_job/index.html | 2508 ++++++ .../omnipy/compute/typing/index.html | 2465 ++++++ .../reference/omnipy/config/engine/index.html | 2524 +++++++ .../reference/omnipy/config/index.html | 2280 ++++++ .../reference/omnipy/config/job/index.html | 2502 ++++++ .../omnipy/config/root_log/index.html | 2714 +++++++ .../reference/omnipy/engine/base/index.html | 2650 +++++++ .../reference/omnipy/engine/index.html | 2280 ++++++ .../omnipy/engine/job_runner/index.html | 3492 +++++++++ .../reference/omnipy/engine/local/index.html | 2517 +++++++ .../reference/omnipy/hub/entry/index.html | 2449 ++++++ .../reference/omnipy/hub/index.html | 2280 ++++++ .../reference/omnipy/hub/root_log/index.html | 2825 +++++++ .../reference/omnipy/hub/runtime/index.html | 3216 ++++++++ docs/mkdocs_site/reference/omnipy/index.html | 2356 ++++++ .../reference/omnipy/log/constants/index.html | 2350 ++++++ .../reference/omnipy/log/index.html | 2280 ++++++ .../reference/omnipy/log/mixin/index.html | 2573 +++++++ .../reference/omnipy/log/registry/index.html | 2755 +++++++ .../fairtracks/create_filter/index.html | 3078 ++++++++ .../modules/fairtracks/functions/index.html | 2554 +++++++ .../fairtracks/get_from_filter/index.html | 2517 +++++++ .../omnipy/modules/fairtracks/index.html | 2282 ++++++ .../modules/fairtracks/tasks/index.html | 2376 ++++++ .../omnipy/modules/general/index.html | 2282 ++++++ .../omnipy/modules/general/models/index.html | 2380 ++++++ .../omnipy/modules/general/tasks/index.html | 2531 +++++++ .../reference/omnipy/modules/index.html | 2280 ++++++ .../omnipy/modules/json/datasets/index.html | 2974 ++++++++ .../omnipy/modules/json/flows/index.html | 2390 ++++++ .../omnipy/modules/json/functions/index.html | 2663 +++++++ .../reference/omnipy/modules/json/index.html | 2282 ++++++ .../omnipy/modules/json/models/index.html | 3134 ++++++++ .../modules/json/serializers/index.html | 2717 +++++++ .../omnipy/modules/json/tasks/index.html | 2655 +++++++ .../omnipy/modules/json/types/index.html | 3040 ++++++++ .../omnipy/modules/pandas/index.html | 2282 ++++++ .../omnipy/modules/pandas/models/index.html | 2661 +++++++ .../modules/pandas/serializers/index.html | 2733 +++++++ .../omnipy/modules/pandas/tasks/index.html | 2626 +++++++ .../omnipy/modules/prefect/engine/index.html | 2284 ++++++ .../modules/prefect/engine/prefect/index.html | 2729 +++++++ .../omnipy/modules/prefect/index.html | 2352 ++++++ .../reference/omnipy/modules/raw/index.html | 2282 ++++++ .../omnipy/modules/raw/protocols/index.html | 2661 +++++++ .../omnipy/modules/raw/serializers/index.html | 2717 +++++++ .../omnipy/modules/raw/tasks/index.html | 2480 ++++++ .../omnipy/modules/tables/index.html | 2282 ++++++ .../omnipy/modules/tables/models/index.html | 2448 ++++++ .../omnipy/modules/tables/tasks/index.html | 2382 ++++++ .../util/callable_decorator_cls/index.html | 2544 +++++++ .../omnipy/util/dataframe/index.html | 2480 ++++++ .../reference/omnipy/util/helpers/index.html | 2733 +++++++ .../reference/omnipy/util/index.html | 2280 ++++++ .../reference/omnipy/util/mixin/index.html | 3179 ++++++++ .../omnipy/util/param_key_mapper/index.html | 2661 +++++++ .../omnipy/util/publisher/index.html | 2561 +++++++ docs/mkdocs_site/search/search_index.json | 1 + docs/mkdocs_site/sitemap.xml | 3 + docs/mkdocs_site/sitemap.xml.gz | Bin 0 -> 127 bytes docs/source/autoapi/index.rst | 11 + .../source/autoapi/omnipy/api/enums/index.rst | 363 + .../autoapi/omnipy/api/exceptions/index.rst | 16 + docs/source/autoapi/omnipy/api/index.rst | 28 + .../autoapi/omnipy/api/protocols/index.rst | 18 + .../api/protocols/private/compute/index.rst | 19 + .../protocols/private/compute/job/index.rst | 580 ++ .../private/compute/job_creator/index.rst | 92 + .../private/compute/mixins/index.rst | 65 + .../api/protocols/private/config/index.rst | 37 + .../api/protocols/private/engine/index.rst | 76 + .../omnipy/api/protocols/private/index.rst | 29 + .../api/protocols/private/log/index.rst | 97 + .../api/protocols/private/util/index.rst | 82 + .../api/protocols/public/compute/index.rst | 566 ++ .../api/protocols/public/config/index.rst | 90 + .../api/protocols/public/engine/index.rst | 202 + .../omnipy/api/protocols/public/hub/index.rst | 138 + .../omnipy/api/protocols/public/index.rst | 20 + .../source/autoapi/omnipy/api/types/index.rst | 55 + .../autoapi/omnipy/compute/flow/index.rst | 517 ++ .../autoapi/omnipy/compute/func_job/index.rst | 142 + docs/source/autoapi/omnipy/compute/index.rst | 32 + .../autoapi/omnipy/compute/job/index.rst | 190 + .../omnipy/compute/job_creator/index.rst | 68 + .../compute/mixins/flow_context/index.rst | 35 + .../compute/mixins/func_signature/index.rst | 52 + .../autoapi/omnipy/compute/mixins/index.rst | 24 + .../omnipy/compute/mixins/iterate/index.rst | 35 + .../compute/mixins/mixin_types/index.rst | 104 + .../omnipy/compute/mixins/name/index.rst | 61 + .../omnipy/compute/mixins/params/index.rst | 35 + .../compute/mixins/result_key/index.rst | 35 + .../omnipy/compute/mixins/serialize/index.rst | 55 + .../autoapi/omnipy/compute/task/index.rst | 201 + .../omnipy/compute/tasklist_job/index.rst | 84 + .../autoapi/omnipy/compute/typing/index.rst | 46 + .../autoapi/omnipy/config/engine/index.rst | 77 + docs/source/autoapi/omnipy/config/index.rst | 19 + .../autoapi/omnipy/config/job/index.rst | 61 + .../autoapi/omnipy/config/root_log/index.rst | 107 + .../autoapi/omnipy/engine/base/index.rst | 73 + docs/source/autoapi/omnipy/engine/index.rst | 19 + .../omnipy/engine/job_runner/index.rst | 293 + .../autoapi/omnipy/engine/local/index.rst | 104 + .../source/autoapi/omnipy/hub/entry/index.rst | 59 + docs/source/autoapi/omnipy/hub/index.rst | 19 + .../autoapi/omnipy/hub/root_log/index.rst | 185 + .../autoapi/omnipy/hub/runtime/index.rst | 143 + docs/source/autoapi/omnipy/index.rst | 49 + .../autoapi/omnipy/log/constants/index.rst | 24 + docs/source/autoapi/omnipy/log/index.rst | 19 + .../source/autoapi/omnipy/log/mixin/index.rst | 52 + .../autoapi/omnipy/log/registry/index.rst | 74 + .../fairtracks/create_filter/index.rst | 153 + .../modules/fairtracks/functions/index.rst | 64 + .../fairtracks/get_from_filter/index.rst | 22 + .../omnipy/modules/fairtracks/index.rst | 20 + .../omnipy/modules/fairtracks/tasks/index.rst | 31 + .../autoapi/omnipy/modules/general/index.rst | 18 + .../omnipy/modules/general/models/index.rst | 37 + .../omnipy/modules/general/tasks/index.rst | 55 + docs/source/autoapi/omnipy/modules/index.rst | 23 + .../omnipy/modules/json/datasets/index.rst | 174 + .../omnipy/modules/json/flows/index.rst | 31 + .../omnipy/modules/json/functions/index.rst | 56 + .../autoapi/omnipy/modules/json/index.rst | 23 + .../omnipy/modules/json/models/index.rst | 209 + .../omnipy/modules/json/serializers/index.rst | 91 + .../omnipy/modules/json/tasks/index.rst | 70 + .../omnipy/modules/json/types/index.rst | 188 + .../autoapi/omnipy/modules/pandas/index.rst | 19 + .../omnipy/modules/pandas/models/index.rst | 86 + .../modules/pandas/serializers/index.rst | 91 + .../omnipy/modules/pandas/tasks/index.rst | 51 + .../omnipy/modules/prefect/engine/index.rst | 17 + .../modules/prefect/engine/prefect/index.rst | 104 + .../autoapi/omnipy/modules/prefect/index.rst | 45 + .../autoapi/omnipy/modules/raw/index.rst | 19 + .../omnipy/modules/raw/protocols/index.rst | 110 + .../omnipy/modules/raw/serializers/index.rst | 91 + .../omnipy/modules/raw/tasks/index.rst | 41 + .../autoapi/omnipy/modules/tables/index.rst | 18 + .../omnipy/modules/tables/models/index.rst | 59 + .../omnipy/modules/tables/tasks/index.rst | 31 + .../util/callable_decorator_cls/index.rst | 39 + .../autoapi/omnipy/util/dataframe/index.rst | 41 + .../autoapi/omnipy/util/helpers/index.rst | 86 + docs/source/autoapi/omnipy/util/index.rst | 22 + .../autoapi/omnipy/util/mixin/index.rst | 83 + .../omnipy/util/param_key_mapper/index.rst | 62 + .../autoapi/omnipy/util/publisher/index.rst | 57 + 233 files changed, 263203 insertions(+) create mode 100644 docs/mkdocs_site/404.html create mode 100644 docs/mkdocs_site/assets/_mkdocstrings.css create mode 100644 docs/mkdocs_site/assets/images/favicon.png create mode 100644 docs/mkdocs_site/assets/javascripts/bundle.b4d07000.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/bundle.b4d07000.min.js.map create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/tinyseg.js create mode 100644 docs/mkdocs_site/assets/javascripts/lunr/wordcut.js create mode 100644 docs/mkdocs_site/assets/javascripts/workers/search.208ed371.min.js create mode 100644 docs/mkdocs_site/assets/javascripts/workers/search.208ed371.min.js.map create mode 100644 docs/mkdocs_site/assets/stylesheets/main.85bb2934.min.css create mode 100644 docs/mkdocs_site/assets/stylesheets/main.85bb2934.min.css.map create mode 100644 docs/mkdocs_site/assets/stylesheets/palette.a6bdf11c.min.css create mode 100644 docs/mkdocs_site/assets/stylesheets/palette.a6bdf11c.min.css.map create mode 100644 docs/mkdocs_site/gen_ref_pages.py create mode 100644 docs/mkdocs_site/index.html create mode 100644 docs/mkdocs_site/objects.inv create mode 100644 docs/mkdocs_site/reference/SUMMARY/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/enums/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/exceptions/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/job/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/job_creator/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/mixins/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/config/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/engine/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/log/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/private/util/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/public/compute/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/public/config/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/public/engine/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/public/hub/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/protocols/public/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/api/types/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/flow/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/func_job/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/job/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/job_creator/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/flow_context/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/func_signature/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/iterate/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/mixin_types/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/name/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/params/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/result_key/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/mixins/serialize/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/task/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/tasklist_job/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/compute/typing/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/config/engine/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/config/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/config/job/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/config/root_log/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/engine/base/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/engine/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/engine/job_runner/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/engine/local/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/hub/entry/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/hub/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/hub/root_log/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/hub/runtime/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/log/constants/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/log/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/log/mixin/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/log/registry/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/fairtracks/create_filter/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/fairtracks/functions/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/fairtracks/get_from_filter/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/fairtracks/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/fairtracks/tasks/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/general/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/general/models/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/general/tasks/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/json/datasets/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/json/flows/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/json/functions/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/json/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/json/models/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/json/serializers/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/json/tasks/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/json/types/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/pandas/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/pandas/models/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/pandas/serializers/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/pandas/tasks/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/prefect/engine/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/prefect/engine/prefect/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/prefect/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/raw/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/raw/protocols/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/raw/serializers/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/raw/tasks/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/tables/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/tables/models/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/modules/tables/tasks/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/util/callable_decorator_cls/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/util/dataframe/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/util/helpers/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/util/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/util/mixin/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/util/param_key_mapper/index.html create mode 100644 docs/mkdocs_site/reference/omnipy/util/publisher/index.html create mode 100644 docs/mkdocs_site/search/search_index.json create mode 100644 docs/mkdocs_site/sitemap.xml create mode 100644 docs/mkdocs_site/sitemap.xml.gz create mode 100644 docs/source/autoapi/index.rst create mode 100644 docs/source/autoapi/omnipy/api/enums/index.rst create mode 100644 docs/source/autoapi/omnipy/api/exceptions/index.rst create mode 100644 docs/source/autoapi/omnipy/api/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/compute/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/compute/job/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/compute/job_creator/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/compute/mixins/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/config/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/engine/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/log/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/private/util/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/public/compute/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/public/config/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/public/engine/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/public/hub/index.rst create mode 100644 docs/source/autoapi/omnipy/api/protocols/public/index.rst create mode 100644 docs/source/autoapi/omnipy/api/types/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/flow/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/func_job/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/job/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/job_creator/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/flow_context/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/func_signature/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/iterate/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/mixin_types/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/name/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/params/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/result_key/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/mixins/serialize/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/task/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/tasklist_job/index.rst create mode 100644 docs/source/autoapi/omnipy/compute/typing/index.rst create mode 100644 docs/source/autoapi/omnipy/config/engine/index.rst create mode 100644 docs/source/autoapi/omnipy/config/index.rst create mode 100644 docs/source/autoapi/omnipy/config/job/index.rst create mode 100644 docs/source/autoapi/omnipy/config/root_log/index.rst create mode 100644 docs/source/autoapi/omnipy/engine/base/index.rst create mode 100644 docs/source/autoapi/omnipy/engine/index.rst create mode 100644 docs/source/autoapi/omnipy/engine/job_runner/index.rst create mode 100644 docs/source/autoapi/omnipy/engine/local/index.rst create mode 100644 docs/source/autoapi/omnipy/hub/entry/index.rst create mode 100644 docs/source/autoapi/omnipy/hub/index.rst create mode 100644 docs/source/autoapi/omnipy/hub/root_log/index.rst create mode 100644 docs/source/autoapi/omnipy/hub/runtime/index.rst create mode 100644 docs/source/autoapi/omnipy/index.rst create mode 100644 docs/source/autoapi/omnipy/log/constants/index.rst create mode 100644 docs/source/autoapi/omnipy/log/index.rst create mode 100644 docs/source/autoapi/omnipy/log/mixin/index.rst create mode 100644 docs/source/autoapi/omnipy/log/registry/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/fairtracks/create_filter/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/fairtracks/functions/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/fairtracks/get_from_filter/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/fairtracks/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/fairtracks/tasks/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/general/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/general/models/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/general/tasks/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/json/datasets/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/json/flows/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/json/functions/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/json/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/json/models/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/json/serializers/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/json/tasks/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/json/types/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/pandas/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/pandas/models/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/pandas/serializers/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/pandas/tasks/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/prefect/engine/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/prefect/engine/prefect/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/prefect/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/raw/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/raw/protocols/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/raw/serializers/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/raw/tasks/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/tables/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/tables/models/index.rst create mode 100644 docs/source/autoapi/omnipy/modules/tables/tasks/index.rst create mode 100644 docs/source/autoapi/omnipy/util/callable_decorator_cls/index.rst create mode 100644 docs/source/autoapi/omnipy/util/dataframe/index.rst create mode 100644 docs/source/autoapi/omnipy/util/helpers/index.rst create mode 100644 docs/source/autoapi/omnipy/util/index.rst create mode 100644 docs/source/autoapi/omnipy/util/mixin/index.rst create mode 100644 docs/source/autoapi/omnipy/util/param_key_mapper/index.rst create mode 100644 docs/source/autoapi/omnipy/util/publisher/index.rst diff --git a/docs/mkdocs_site/404.html b/docs/mkdocs_site/404.html new file mode 100644 index 00000000..b3200ce1 --- /dev/null +++ b/docs/mkdocs_site/404.html @@ -0,0 +1,2216 @@ + + + + + + + + + + + + + + + + + + Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ +

404 - Not found

+ +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/assets/_mkdocstrings.css b/docs/mkdocs_site/assets/_mkdocstrings.css new file mode 100644 index 00000000..a65078d0 --- /dev/null +++ b/docs/mkdocs_site/assets/_mkdocstrings.css @@ -0,0 +1,36 @@ + +/* Don't capitalize names. */ +h5.doc-heading { + text-transform: none !important; +} + +/* Avoid breaking parameters name, etc. in table cells. */ +.doc-contents td code { + word-break: normal !important; +} + +/* For pieces of Markdown rendered in table cells. */ +.doc-contents td p { + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +/* Max width for docstring sections tables. */ +.doc .md-typeset__table, +.doc .md-typeset__table table { + display: table !important; + width: 100%; +} +.doc .md-typeset__table tr { + display: table-row; +} + +/* Avoid line breaks in rendered fields. */ +.field-body p { + display: inline; +} + +/* Defaults in Spacy table style. */ +.doc-param-default { + float: right; +} diff --git a/docs/mkdocs_site/assets/images/favicon.png b/docs/mkdocs_site/assets/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1cf13b9f9d978896599290a74f77d5dbe7d1655c GIT binary patch literal 1870 zcmV-U2eJ5xP)Gc)JR9QMau)O=X#!i9;T z37kk-upj^(fsR36MHs_+1RCI)NNu9}lD0S{B^g8PN?Ww(5|~L#Ng*g{WsqleV}|#l zz8@ri&cTzw_h33bHI+12+kK6WN$h#n5cD8OQt`5kw6p~9H3()bUQ8OS4Q4HTQ=1Ol z_JAocz`fLbT2^{`8n~UAo=#AUOf=SOq4pYkt;XbC&f#7lb$*7=$na!mWCQ`dBQsO0 zLFBSPj*N?#u5&pf2t4XjEGH|=pPQ8xh7tpx;US5Cx_Ju;!O`ya-yF`)b%TEt5>eP1ZX~}sjjA%FJF?h7cX8=b!DZl<6%Cv z*G0uvvU+vmnpLZ2paivG-(cd*y3$hCIcsZcYOGh{$&)A6*XX&kXZd3G8m)G$Zz-LV z^GF3VAW^Mdv!)4OM8EgqRiz~*Cji;uzl2uC9^=8I84vNp;ltJ|q-*uQwGp2ma6cY7 z;`%`!9UXO@fr&Ebapfs34OmS9^u6$)bJxrucutf>`dKPKT%%*d3XlFVKunp9 zasduxjrjs>f8V=D|J=XNZp;_Zy^WgQ$9WDjgY=z@stwiEBm9u5*|34&1Na8BMjjgf3+SHcr`5~>oz1Y?SW^=K z^bTyO6>Gar#P_W2gEMwq)ot3; zREHn~U&Dp0l6YT0&k-wLwYjb?5zGK`W6S2v+K>AM(95m2C20L|3m~rN8dprPr@t)5lsk9Hu*W z?pS990s;Ez=+Rj{x7p``4>+c0G5^pYnB1^!TL=(?HLHZ+HicG{~4F1d^5Awl_2!1jICM-!9eoLhbbT^;yHcefyTAaqRcY zmuctDopPT!%k+}x%lZRKnzykr2}}XfG_ne?nRQO~?%hkzo;@RN{P6o`&mMUWBYMTe z6i8ChtjX&gXl`nvrU>jah)2iNM%JdjqoaeaU%yVn!^70x-flljp6Q5tK}5}&X8&&G zX3fpb3E(!rH=zVI_9Gjl45w@{(ITqngWFe7@9{mX;tO25Z_8 zQHEpI+FkTU#4xu>RkN>b3Tnc3UpWzPXWm#o55GKF09j^Mh~)K7{QqbO_~(@CVq! zS<8954|P8mXN2MRs86xZ&Q4EfM@JB94b=(YGuk)s&^jiSF=t3*oNK3`rD{H`yQ?d; ztE=laAUoZx5?RC8*WKOj`%LXEkgDd>&^Q4M^z`%u0rg-It=hLCVsq!Z%^6eB-OvOT zFZ28TN&cRmgU}Elrnk43)!>Z1FCPL2K$7}gwzIc48NX}#!A1BpJP?#v5wkNprhV** z?Cpalt1oH&{r!o3eSKc&ap)iz2BTn_VV`4>9M^b3;(YY}4>#ML6{~(4mH+?%07*qo IM6N<$f(jP3KmY&$ literal 0 HcmV?d00001 diff --git a/docs/mkdocs_site/assets/javascripts/bundle.b4d07000.min.js b/docs/mkdocs_site/assets/javascripts/bundle.b4d07000.min.js new file mode 100644 index 00000000..3c0bdad9 --- /dev/null +++ b/docs/mkdocs_site/assets/javascripts/bundle.b4d07000.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var Ci=Object.create;var gr=Object.defineProperty;var Ri=Object.getOwnPropertyDescriptor;var ki=Object.getOwnPropertyNames,Ht=Object.getOwnPropertySymbols,Hi=Object.getPrototypeOf,yr=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable;var rn=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))yr.call(t,r)&&rn(e,r,t[r]);if(Ht)for(var r of Ht(t))nn.call(t,r)&&rn(e,r,t[r]);return e};var on=(e,t)=>{var r={};for(var n in e)yr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ht)for(var n of Ht(e))t.indexOf(n)<0&&nn.call(e,n)&&(r[n]=e[n]);return r};var Pt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ki(t))!yr.call(e,o)&&o!==r&&gr(e,o,{get:()=>t[o],enumerable:!(n=Ri(t,o))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?Ci(Hi(e)):{},Pi(t||!e||!e.__esModule?gr(r,"default",{value:e,enumerable:!0}):r,e));var sn=Pt((xr,an)=>{(function(e,t){typeof xr=="object"&&typeof an!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(xr,function(){"use strict";function e(r){var n=!0,o=!1,i=null,s={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function a(O){return!!(O&&O!==document&&O.nodeName!=="HTML"&&O.nodeName!=="BODY"&&"classList"in O&&"contains"in O.classList)}function f(O){var Qe=O.type,De=O.tagName;return!!(De==="INPUT"&&s[Qe]&&!O.readOnly||De==="TEXTAREA"&&!O.readOnly||O.isContentEditable)}function c(O){O.classList.contains("focus-visible")||(O.classList.add("focus-visible"),O.setAttribute("data-focus-visible-added",""))}function u(O){O.hasAttribute("data-focus-visible-added")&&(O.classList.remove("focus-visible"),O.removeAttribute("data-focus-visible-added"))}function p(O){O.metaKey||O.altKey||O.ctrlKey||(a(r.activeElement)&&c(r.activeElement),n=!0)}function m(O){n=!1}function d(O){a(O.target)&&(n||f(O.target))&&c(O.target)}function h(O){a(O.target)&&(O.target.classList.contains("focus-visible")||O.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),u(O.target))}function v(O){document.visibilityState==="hidden"&&(o&&(n=!0),Y())}function Y(){document.addEventListener("mousemove",N),document.addEventListener("mousedown",N),document.addEventListener("mouseup",N),document.addEventListener("pointermove",N),document.addEventListener("pointerdown",N),document.addEventListener("pointerup",N),document.addEventListener("touchmove",N),document.addEventListener("touchstart",N),document.addEventListener("touchend",N)}function B(){document.removeEventListener("mousemove",N),document.removeEventListener("mousedown",N),document.removeEventListener("mouseup",N),document.removeEventListener("pointermove",N),document.removeEventListener("pointerdown",N),document.removeEventListener("pointerup",N),document.removeEventListener("touchmove",N),document.removeEventListener("touchstart",N),document.removeEventListener("touchend",N)}function N(O){O.target.nodeName&&O.target.nodeName.toLowerCase()==="html"||(n=!1,B())}document.addEventListener("keydown",p,!0),document.addEventListener("mousedown",m,!0),document.addEventListener("pointerdown",m,!0),document.addEventListener("touchstart",m,!0),document.addEventListener("visibilitychange",v,!0),Y(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var cn=Pt(Er=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(c){return!1}},r=t(),n=function(c){var u={next:function(){var p=c.shift();return{done:p===void 0,value:p}}};return r&&(u[Symbol.iterator]=function(){return u}),u},o=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},i=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},s=function(){var c=function(p){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var m=typeof p;if(m!=="undefined")if(m==="string")p!==""&&this._fromString(p);else if(p instanceof c){var d=this;p.forEach(function(B,N){d.append(N,B)})}else if(p!==null&&m==="object")if(Object.prototype.toString.call(p)==="[object Array]")for(var h=0;hd[0]?1:0}),c._entries&&(c._entries={});for(var p=0;p1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Er);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(f,c){typeof f!="string"&&(f=String(f)),c&&typeof c!="string"&&(c=String(c));var u=document,p;if(c&&(e.location===void 0||c!==e.location.href)){c=c.toLowerCase(),u=document.implementation.createHTMLDocument(""),p=u.createElement("base"),p.href=c,u.head.appendChild(p);try{if(p.href.indexOf(c)!==0)throw new Error(p.href)}catch(O){throw new Error("URL unable to set base "+c+" due to "+O)}}var m=u.createElement("a");m.href=f,p&&(u.body.appendChild(m),m.href=m.href);var d=u.createElement("input");if(d.type="url",d.value=f,m.protocol===":"||!/:/.test(m.href)||!d.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:m});var h=new e.URLSearchParams(this.search),v=!0,Y=!0,B=this;["append","delete","set"].forEach(function(O){var Qe=h[O];h[O]=function(){Qe.apply(h,arguments),v&&(Y=!1,B.search=h.toString(),Y=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var N=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==N&&(N=this.search,Y&&(v=!1,this.searchParams._fromString(this.search),v=!0))}})},s=i.prototype,a=function(f){Object.defineProperty(s,f,{get:function(){return this._anchorElement[f]},set:function(c){this._anchorElement[f]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(f){a(f)}),Object.defineProperty(s,"search",{get:function(){return this._anchorElement.search},set:function(f){this._anchorElement.search=f,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(s,{toString:{get:function(){var f=this;return function(){return f.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(f){this._anchorElement.href=f,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(f){this._anchorElement.pathname=f},enumerable:!0},origin:{get:function(){var f={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=f&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(f){},enumerable:!0},username:{get:function(){return""},set:function(f){},enumerable:!0}}),i.createObjectURL=function(f){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(f){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Er)});var qr=Pt((Mt,Nr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Mt=="object"&&typeof Nr=="object"?Nr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Mt=="object"?Mt.ClipboardJS=r():t.ClipboardJS=r()})(Mt,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return Ai}});var s=i(279),a=i.n(s),f=i(370),c=i.n(f),u=i(817),p=i.n(u);function m(j){try{return document.execCommand(j)}catch(T){return!1}}var d=function(T){var E=p()(T);return m("cut"),E},h=d;function v(j){var T=document.documentElement.getAttribute("dir")==="rtl",E=document.createElement("textarea");E.style.fontSize="12pt",E.style.border="0",E.style.padding="0",E.style.margin="0",E.style.position="absolute",E.style[T?"right":"left"]="-9999px";var H=window.pageYOffset||document.documentElement.scrollTop;return E.style.top="".concat(H,"px"),E.setAttribute("readonly",""),E.value=j,E}var Y=function(T,E){var H=v(T);E.container.appendChild(H);var I=p()(H);return m("copy"),H.remove(),I},B=function(T){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},H="";return typeof T=="string"?H=Y(T,E):T instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(T==null?void 0:T.type)?H=Y(T.value,E):(H=p()(T),m("copy")),H},N=B;function O(j){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O=function(E){return typeof E}:O=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},O(j)}var Qe=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=T.action,H=E===void 0?"copy":E,I=T.container,q=T.target,Me=T.text;if(H!=="copy"&&H!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(q!==void 0)if(q&&O(q)==="object"&&q.nodeType===1){if(H==="copy"&&q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(H==="cut"&&(q.hasAttribute("readonly")||q.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Me)return N(Me,{container:I});if(q)return H==="cut"?h(q):N(q,{container:I})},De=Qe;function $e(j){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$e=function(E){return typeof E}:$e=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},$e(j)}function Ei(j,T){if(!(j instanceof T))throw new TypeError("Cannot call a class as a function")}function tn(j,T){for(var E=0;E0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof I.action=="function"?I.action:this.defaultAction,this.target=typeof I.target=="function"?I.target:this.defaultTarget,this.text=typeof I.text=="function"?I.text:this.defaultText,this.container=$e(I.container)==="object"?I.container:document.body}},{key:"listenClick",value:function(I){var q=this;this.listener=c()(I,"click",function(Me){return q.onClick(Me)})}},{key:"onClick",value:function(I){var q=I.delegateTarget||I.currentTarget,Me=this.action(q)||"copy",kt=De({action:Me,container:this.container,target:this.target(q),text:this.text(q)});this.emit(kt?"success":"error",{action:Me,text:kt,trigger:q,clearSelection:function(){q&&q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(I){return vr("action",I)}},{key:"defaultTarget",value:function(I){var q=vr("target",I);if(q)return document.querySelector(q)}},{key:"defaultText",value:function(I){return vr("text",I)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(I){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return N(I,q)}},{key:"cut",value:function(I){return h(I)}},{key:"isSupported",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],q=typeof I=="string"?[I]:I,Me=!!document.queryCommandSupported;return q.forEach(function(kt){Me=Me&&!!document.queryCommandSupported(kt)}),Me}}]),E}(a()),Ai=Li},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function s(a,f){for(;a&&a.nodeType!==o;){if(typeof a.matches=="function"&&a.matches(f))return a;a=a.parentNode}}n.exports=s},438:function(n,o,i){var s=i(828);function a(u,p,m,d,h){var v=c.apply(this,arguments);return u.addEventListener(m,v,h),{destroy:function(){u.removeEventListener(m,v,h)}}}function f(u,p,m,d,h){return typeof u.addEventListener=="function"?a.apply(null,arguments):typeof m=="function"?a.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(v){return a(v,p,m,d,h)}))}function c(u,p,m,d){return function(h){h.delegateTarget=s(h.target,p),h.delegateTarget&&d.call(u,h)}}n.exports=f},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var s=Object.prototype.toString.call(i);return i!==void 0&&(s==="[object NodeList]"||s==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var s=Object.prototype.toString.call(i);return s==="[object Function]"}},370:function(n,o,i){var s=i(879),a=i(438);function f(m,d,h){if(!m&&!d&&!h)throw new Error("Missing required arguments");if(!s.string(d))throw new TypeError("Second argument must be a String");if(!s.fn(h))throw new TypeError("Third argument must be a Function");if(s.node(m))return c(m,d,h);if(s.nodeList(m))return u(m,d,h);if(s.string(m))return p(m,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(m,d,h){return m.addEventListener(d,h),{destroy:function(){m.removeEventListener(d,h)}}}function u(m,d,h){return Array.prototype.forEach.call(m,function(v){v.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(m,function(v){v.removeEventListener(d,h)})}}}function p(m,d,h){return a(document.body,m,d,h)}n.exports=f},817:function(n){function o(i){var s;if(i.nodeName==="SELECT")i.focus(),s=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var a=i.hasAttribute("readonly");a||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),a||i.removeAttribute("readonly"),s=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var f=window.getSelection(),c=document.createRange();c.selectNodeContents(i),f.removeAllRanges(),f.addRange(c),s=f.toString()}return s}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,s,a){var f=this.e||(this.e={});return(f[i]||(f[i]=[])).push({fn:s,ctx:a}),this},once:function(i,s,a){var f=this;function c(){f.off(i,c),s.apply(a,arguments)}return c._=s,this.on(i,c,a)},emit:function(i){var s=[].slice.call(arguments,1),a=((this.e||(this.e={}))[i]||[]).slice(),f=0,c=a.length;for(f;f{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var rs=/["'&<>]/;Yo.exports=ns;function ns(e){var t=""+e,r=rs.exec(t);if(!r)return t;var n,o="",i=0,s=0;for(i=r.index;i0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i}function D(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n1||a(m,d)})})}function a(m,d){try{f(n[m](d))}catch(h){p(i[0][3],h)}}function f(m){m.value instanceof et?Promise.resolve(m.value.v).then(c,u):p(i[0][2],m)}function c(m){a("next",m)}function u(m){a("throw",m)}function p(m,d){m(d),i.shift(),i.length&&a(i[0][0],i[0][1])}}function pn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ee=="function"?Ee(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(s){return new Promise(function(a,f){s=e[i](s),o(a,f,s.done,s.value)})}}function o(i,s,a,f){Promise.resolve(f).then(function(c){i({value:c,done:a})},s)}}function C(e){return typeof e=="function"}function at(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var It=at(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +`+r.map(function(n,o){return o+1+") "+n.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=r}});function Ve(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ie=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=Ee(s),f=a.next();!f.done;f=a.next()){var c=f.value;c.remove(this)}}catch(v){t={error:v}}finally{try{f&&!f.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else s.remove(this);var u=this.initialTeardown;if(C(u))try{u()}catch(v){i=v instanceof It?v.errors:[v]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var m=Ee(p),d=m.next();!d.done;d=m.next()){var h=d.value;try{ln(h)}catch(v){i=i!=null?i:[],v instanceof It?i=D(D([],W(i)),W(v.errors)):i.push(v)}}}catch(v){n={error:v}}finally{try{d&&!d.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}}if(i)throw new It(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)ln(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Ve(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Ve(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Sr=Ie.EMPTY;function jt(e){return e instanceof Ie||e&&"closed"in e&&C(e.remove)&&C(e.add)&&C(e.unsubscribe)}function ln(e){C(e)?e():e.unsubscribe()}var Le={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var st={setTimeout:function(e,t){for(var r=[],n=2;n0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?Sr:(this.currentObservers=null,a.push(r),new Ie(function(){n.currentObservers=null,Ve(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?r.error(i):s&&r.complete()},t.prototype.asObservable=function(){var r=new F;return r.source=this,r},t.create=function(r,n){return new xn(r,n)},t}(F);var xn=function(e){ie(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Sr},t}(x);var Et={now:function(){return(Et.delegate||Date).now()},delegate:void 0};var wt=function(e){ie(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Et);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,a=n._timestampProvider,f=n._windowTime;o||(i.push(r),!s&&i.push(a.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),f=0;f0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=ut.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);var s=r.actions;n!=null&&((i=s[s.length-1])===null||i===void 0?void 0:i.id)!==n&&(ut.cancelAnimationFrame(n),r._scheduled=void 0)},t}(Wt);var Sn=function(e){ie(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t}(Dt);var Oe=new Sn(wn);var _=new F(function(e){return e.complete()});function Vt(e){return e&&C(e.schedule)}function Cr(e){return e[e.length-1]}function Ye(e){return C(Cr(e))?e.pop():void 0}function Te(e){return Vt(Cr(e))?e.pop():void 0}function zt(e,t){return typeof Cr(e)=="number"?e.pop():t}var pt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Nt(e){return C(e==null?void 0:e.then)}function qt(e){return C(e[ft])}function Kt(e){return Symbol.asyncIterator&&C(e==null?void 0:e[Symbol.asyncIterator])}function Qt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zi(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Yt=zi();function Gt(e){return C(e==null?void 0:e[Yt])}function Bt(e){return un(this,arguments,function(){var r,n,o,i;return $t(this,function(s){switch(s.label){case 0:r=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,et(r.read())];case 3:return n=s.sent(),o=n.value,i=n.done,i?[4,et(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,et(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Jt(e){return C(e==null?void 0:e.getReader)}function U(e){if(e instanceof F)return e;if(e!=null){if(qt(e))return Ni(e);if(pt(e))return qi(e);if(Nt(e))return Ki(e);if(Kt(e))return On(e);if(Gt(e))return Qi(e);if(Jt(e))return Yi(e)}throw Qt(e)}function Ni(e){return new F(function(t){var r=e[ft]();if(C(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function qi(e){return new F(function(t){for(var r=0;r=2;return function(n){return n.pipe(e?A(function(o,i){return e(o,i,n)}):de,ge(1),r?He(t):Dn(function(){return new Zt}))}}function Vn(){for(var e=[],t=0;t=2,!0))}function pe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new x}:t,n=e.resetOnError,o=n===void 0?!0:n,i=e.resetOnComplete,s=i===void 0?!0:i,a=e.resetOnRefCountZero,f=a===void 0?!0:a;return function(c){var u,p,m,d=0,h=!1,v=!1,Y=function(){p==null||p.unsubscribe(),p=void 0},B=function(){Y(),u=m=void 0,h=v=!1},N=function(){var O=u;B(),O==null||O.unsubscribe()};return y(function(O,Qe){d++,!v&&!h&&Y();var De=m=m!=null?m:r();Qe.add(function(){d--,d===0&&!v&&!h&&(p=$r(N,f))}),De.subscribe(Qe),!u&&d>0&&(u=new rt({next:function($e){return De.next($e)},error:function($e){v=!0,Y(),p=$r(B,o,$e),De.error($e)},complete:function(){h=!0,Y(),p=$r(B,s),De.complete()}}),U(O).subscribe(u))})(c)}}function $r(e,t){for(var r=[],n=2;ne.next(document)),e}function K(e,t=document){return Array.from(t.querySelectorAll(e))}function z(e,t=document){let r=ce(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function ce(e,t=document){return t.querySelector(e)||void 0}function _e(){return document.activeElement instanceof HTMLElement&&document.activeElement||void 0}function tr(e){return L(b(document.body,"focusin"),b(document.body,"focusout")).pipe(ke(1),l(()=>{let t=_e();return typeof t!="undefined"?e.contains(t):!1}),V(e===_e()),J())}function Xe(e){return{x:e.offsetLeft,y:e.offsetTop}}function Kn(e){return L(b(window,"load"),b(window,"resize")).pipe(Ce(0,Oe),l(()=>Xe(e)),V(Xe(e)))}function rr(e){return{x:e.scrollLeft,y:e.scrollTop}}function dt(e){return L(b(e,"scroll"),b(window,"resize")).pipe(Ce(0,Oe),l(()=>rr(e)),V(rr(e)))}var Yn=function(){if(typeof Map!="undefined")return Map;function e(t,r){var n=-1;return t.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(r,n){var o=e(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,o=e(n,r);~o&&n.splice(o,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!Wr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),va?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Wr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,o=ba.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Gn=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),Jn=typeof WeakMap!="undefined"?new WeakMap:new Yn,Xn=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=ga.getInstance(),n=new La(t,r,this);Jn.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Xn.prototype[e]=function(){var t;return(t=Jn.get(this))[e].apply(t,arguments)}});var Aa=function(){return typeof nr.ResizeObserver!="undefined"?nr.ResizeObserver:Xn}(),Zn=Aa;var eo=new x,Ca=$(()=>k(new Zn(e=>{for(let t of e)eo.next(t)}))).pipe(g(e=>L(ze,k(e)).pipe(R(()=>e.disconnect()))),X(1));function he(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ye(e){return Ca.pipe(S(t=>t.observe(e)),g(t=>eo.pipe(A(({target:r})=>r===e),R(()=>t.unobserve(e)),l(()=>he(e)))),V(he(e)))}function bt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function ar(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}var to=new x,Ra=$(()=>k(new IntersectionObserver(e=>{for(let t of e)to.next(t)},{threshold:0}))).pipe(g(e=>L(ze,k(e)).pipe(R(()=>e.disconnect()))),X(1));function sr(e){return Ra.pipe(S(t=>t.observe(e)),g(t=>to.pipe(A(({target:r})=>r===e),R(()=>t.unobserve(e)),l(({isIntersecting:r})=>r))))}function ro(e,t=16){return dt(e).pipe(l(({y:r})=>{let n=he(e),o=bt(e);return r>=o.height-n.height-t}),J())}var cr={drawer:z("[data-md-toggle=drawer]"),search:z("[data-md-toggle=search]")};function no(e){return cr[e].checked}function Ke(e,t){cr[e].checked!==t&&cr[e].click()}function Ue(e){let t=cr[e];return b(t,"change").pipe(l(()=>t.checked),V(t.checked))}function ka(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ha(){return L(b(window,"compositionstart").pipe(l(()=>!0)),b(window,"compositionend").pipe(l(()=>!1))).pipe(V(!1))}function oo(){let e=b(window,"keydown").pipe(A(t=>!(t.metaKey||t.ctrlKey)),l(t=>({mode:no("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),A(({mode:t,type:r})=>{if(t==="global"){let n=_e();if(typeof n!="undefined")return!ka(n,r)}return!0}),pe());return Ha().pipe(g(t=>t?_:e))}function le(){return new URL(location.href)}function ot(e){location.href=e.href}function io(){return new x}function ao(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)ao(e,r)}function M(e,t,...r){let n=document.createElement(e);if(t)for(let o of Object.keys(t))typeof t[o]!="undefined"&&(typeof t[o]!="boolean"?n.setAttribute(o,t[o]):n.setAttribute(o,""));for(let o of r)ao(n,o);return n}function fr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function so(){return location.hash.substring(1)}function Dr(e){let t=M("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Pa(e){return L(b(window,"hashchange"),e).pipe(l(so),V(so()),A(t=>t.length>0),X(1))}function co(e){return Pa(e).pipe(l(t=>ce(`[id="${t}"]`)),A(t=>typeof t!="undefined"))}function Vr(e){let t=matchMedia(e);return er(r=>t.addListener(()=>r(t.matches))).pipe(V(t.matches))}function fo(){let e=matchMedia("print");return L(b(window,"beforeprint").pipe(l(()=>!0)),b(window,"afterprint").pipe(l(()=>!1))).pipe(V(e.matches))}function zr(e,t){return e.pipe(g(r=>r?t():_))}function ur(e,t={credentials:"same-origin"}){return ue(fetch(`${e}`,t)).pipe(fe(()=>_),g(r=>r.status!==200?Ot(()=>new Error(r.statusText)):k(r)))}function We(e,t){return ur(e,t).pipe(g(r=>r.json()),X(1))}function uo(e,t){let r=new DOMParser;return ur(e,t).pipe(g(n=>n.text()),l(n=>r.parseFromString(n,"text/xml")),X(1))}function pr(e){let t=M("script",{src:e});return $(()=>(document.head.appendChild(t),L(b(t,"load"),b(t,"error").pipe(g(()=>Ot(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(l(()=>{}),R(()=>document.head.removeChild(t)),ge(1))))}function po(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function lo(){return L(b(window,"scroll",{passive:!0}),b(window,"resize",{passive:!0})).pipe(l(po),V(po()))}function mo(){return{width:innerWidth,height:innerHeight}}function ho(){return b(window,"resize",{passive:!0}).pipe(l(mo),V(mo()))}function bo(){return G([lo(),ho()]).pipe(l(([e,t])=>({offset:e,size:t})),X(1))}function lr(e,{viewport$:t,header$:r}){let n=t.pipe(ee("size")),o=G([n,r]).pipe(l(()=>Xe(e)));return G([r,t,o]).pipe(l(([{height:i},{offset:s,size:a},{x:f,y:c}])=>({offset:{x:s.x-f,y:s.y-c+i},size:a})))}(()=>{function e(n,o){parent.postMessage(n,o||"*")}function t(...n){return n.reduce((o,i)=>o.then(()=>new Promise(s=>{let a=document.createElement("script");a.src=i,a.onload=s,document.body.appendChild(a)})),Promise.resolve())}var r=class extends EventTarget{constructor(n){super(),this.url=n,this.m=i=>{i.source===this.w&&(this.dispatchEvent(new MessageEvent("message",{data:i.data})),this.onmessage&&this.onmessage(i))},this.e=(i,s,a,f,c)=>{if(s===`${this.url}`){let u=new ErrorEvent("error",{message:i,filename:s,lineno:a,colno:f,error:c});this.dispatchEvent(u),this.onerror&&this.onerror(u)}};let o=document.createElement("iframe");o.hidden=!0,document.body.appendChild(this.iframe=o),this.w.document.open(),this.w.document.write(` + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

Welcome to MkDocs

+

For full documentation visit mkdocs.org.

+

Commands

+
    +
  • mkdocs new [dir-name] - Create a new project.
  • +
  • mkdocs serve - Start the live-reloading docs server.
  • +
  • mkdocs build - Build the documentation site.
  • +
  • mkdocs -h - Print help message and exit.
  • +
+

Project layout

+
mkdocs.yml    # The configuration file.
+docs/
+    index.md  # The documentation homepage.
+    ...       # Other markdown pages, images and other files.
+
+ + +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ ConfigPersistOutputsOptions + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
21
+22
+23
+24
+25
class ConfigPersistOutputsOptions(str, Enum):
+    """"""
+    DISABLED = 'disabled'
+    ENABLE_FLOW_OUTPUTS = 'flow'
+    ENABLE_FLOW_AND_TASK_OUTPUTS = 'all'
+
+
+ + + +
+ + + + + + + +
+ + + +

+DISABLED = 'disabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ENABLE_FLOW_AND_TASK_OUTPUTS = 'all' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ENABLE_FLOW_OUTPUTS = 'flow' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ ConfigRestoreOutputsOptions + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
28
+29
+30
+31
class ConfigRestoreOutputsOptions(str, Enum):
+    """"""
+    DISABLED = 'disabled'
+    AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params'
+
+
+ + + +
+ + + + + + + +
+ + + +

+AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+DISABLED = 'disabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ EngineChoice + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
34
+35
+36
+37
class EngineChoice(str, Enum):
+    """"""
+    LOCAL = 'local'
+    PREFECT = 'prefect'
+
+
+ + + +
+ + + + + + + +
+ + + +

+LOCAL = 'local' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+PREFECT = 'prefect' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ PersistOutputsOptions + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
 6
+ 7
+ 8
+ 9
+10
class PersistOutputsOptions(str, Enum):
+    """"""
+    DISABLED = 'disabled'
+    FOLLOW_CONFIG = 'config'
+    ENABLED = 'enabled'
+
+
+ + + +
+ + + + + + + +
+ + + +

+DISABLED = 'disabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ENABLED = 'enabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+FOLLOW_CONFIG = 'config' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ RestoreOutputsOptions + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
13
+14
+15
+16
+17
+18
class RestoreOutputsOptions(str, Enum):
+    """"""
+    DISABLED = 'disabled'
+    FOLLOW_CONFIG = 'config'
+    AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params'
+    FORCE_ENABLE_IGNORE_PARAMS = 'force_ignore_params'
+
+
+ + + +
+ + + + + + + +
+ + + +

+AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+DISABLED = 'disabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+FOLLOW_CONFIG = 'config' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+FORCE_ENABLE_IGNORE_PARAMS = 'force_ignore_params' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ RunState + + +

+ + +
+

+ Bases: IntEnum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
40
+41
+42
+43
+44
class RunState(IntEnum):
+    """"""
+    INITIALIZED = 1
+    RUNNING = 2
+    FINISHED = 3
+
+
+ + + +
+ + + + + + + +
+ + + +

+FINISHED = 3 + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+INITIALIZED = 1 + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+RUNNING = 2 + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ RunStateLogMessages + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
52
+53
+54
+55
+56
class RunStateLogMessages(str, Enum):
+    """"""
+    INITIALIZED = 'Initialized "{}"'
+    RUNNING = 'Started running "{}"...'
+    FINISHED = 'Finished running "{}"!'
+
+
+ + + +
+ + + + + + + +
+ + + +

+FINISHED = 'Finished running "{}"!' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+INITIALIZED = 'Initialized "{}"' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+RUNNING = 'Started running "{}"...' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/objects.inv b/docs/mkdocs_site/objects.inv new file mode 100644 index 0000000000000000000000000000000000000000..595bf2e517bc02ee0f5a9cb02e90bea38ec587c5 GIT binary patch literal 5598 zcmV<46(Q;)AX9K?X>NERX>N99Zgg*Qc_4OWa&u{KZXhxWBOp+6Z)#;@bUGkUZEk6B zc?u&SR%LQ?X>V>iATTa4E-(rsAXI2&AaZ4GVQFq;WpW^IW*~HEX>%ZEX>4U6X>%ZB zZ*6dLWpi_7WFU2OX>MmAdTeQ8E(&|kg ze}1XhhE=Rc**{A4<3IlUZ@>Kgznag9d3<50CRd$>jN-EGMsjkoouJ%lGAL3{G!U3&!iRV&1FeB5pGI zzMPY`9J6oF^Tm|BOcs-;PzCYQ4yMI6E7;vznWfB0Gee-{aeg;>^d(mEvY0+h@0Koj z{yS*6t~u600sueEA7!Vzn?FCyzPZ5r?`;wLS-2i{89A)h1^nV}>R(BR;;SkreI)~71 zn*B^!Kd>0gwl3`mO!9lVQX)?ESLQmpj$0r13?P|Gb~$r$&(gA@qD$XN8J1)AuL^MIAKbe)EK8t$ zRn}!%=79FxCA|(JK4tIi)By!+vzS4XR5eW->?S9eBAM~7C;Upec_#GEnCu%Xj>sA% z>#QPsTECe_({N&xjo}erfT}TkA_%~gGh)-anw($?QO0Sf{N=QzSRQPVspf0ZkK18O^rTd_Xv>~t$NWMox|?ijR=u)( z6Rp6fv~fzFmOEieGCMy)WrdR@qD#0CiR?Hsq1y+cxJkABy{$Kl8NpmXNU5gRgFWr$#QmEnUq?{4|XIwy8j6z;n}vJ z^`W}8THO6@Z?brBy?x4Z$ZOeNZY+jqA_b}2CB>V`@sWvH@@Hx*N}!*q!Kj4?X-m** z%WpjoC2y3Iw5)_;gp*CAD7O?zFB#u#dej1lZ2SE9GpIuJ>`l8OcWY6!X?*kA(SkTy zQB;&N!zjYW1{olz>L>} zcE5BSwZ0X1zZnsqJ1d&TF3MlC&-yk(5W@a*qb7f&>2Ww4^_`B?18HuiiliO*;tKGR z)2z6uM?c(P7ed@%KDr>m&!Gp^OKb6c*Fqy3{1;@pQO_Nb=hOa7hPyQ1i|juKmLH$#j;-B{XMaK@1>HGJ86E{Ws4vJ*Bahn=o&W+> zY^zSU3t#w5S0Tkatnw^Hjb|!{5z^}9K?4mqcyK}?lzC6L4|(~4>2j`IHvX42XSBje zqQr7V%#Bn}_@ac^ncayvZas>g9Iq~0vZy6|6y`RqqLs0yi&{$Q-$x^gQZn>y6U|_{ zaWEtpI%zhgL2{`(QHw(%X4Pn%FA_JcZBMBCV@(d6k(8!y!eMGolyHk76)DG}EbGT| z8?D?Ye2F~iMe=fMbBD;U0K2R}`_o<|$kjE#_^ey9DXSf=39qYLu-BzJ=XWD&UawhI z-HyCG)UnB%BHy;LHzkiGgTfBvr)-s=wuR%A{_U``7=J`A z5OhDh&R2g4W0K=_YE9KxPH(hW=L|oOI?yVkrH;zk&YbZJ+fJ7^Ahz8k#1r=+_QJK? zh6BGvY|T{m{V_C^<*K+fpYTjYF9wqFSWb}Dt zb(T~fEA3rTNDv|zTfgiPg>Ja45S&mJ%^0_!gK1NbLM4b({5W9j9RX)_@F45XgugWk z;sjUi2tb0-H2??TIbzVvegy^%aUlu=3%lZkL&P;r1Ll)FDdnSv6_EY4N)!w93IP(- zzhV(LD^akp&?`VlJwJPE3MYWRE9)HGYo(ongKn-{AzR%2v*Ll>OtOPE-xdVm!fxf5 z&aPiNRo{-6PpqcUHf@6q_2yk^u$LAr`5>1y+@Nt*fDHl4Ft8zrTNggAgg8n7zVYDB z^NAeI?P$=Gh7ApT`^N(j?7|n6sBX`BnulbW@+w4PJTD4|0ed25DAa<)INZtQXh&y# zlqr`{puk?;FozK`vAKWll?idj+%GS7Brvlc_gS$8R+36P0+Z~H`y<(8pXAHB7g%68 z$Jf=a03?^zxB}3ev?mYvkn4{lcaP34L7gu&fH8*|p#*CAy1gri^7lP+CfMZ_-~5=1 zHlbv|jyG6-*@e3(m$;^Nk`+#pyy{PKVN-i7=tkz9U8uTC)#w{q*ZxJpL>~<=4KTiC zj2g1*4E`lS1(LKDrw!4I>XvOD0BkaA{&(qy?rb)3i2Vy;*|Gr4>OTT_9PA8wkPir- z%nI?#z0ja=??xYf@lMDR(D+Z(|NpyMcjM=6=X1enOc4Ym`E6@f99hZhoHoDMHsmh%&aENIne zL((R22a>jbS^?aOn=EF~L_JKxT?{5iD)93Wo@v1kGkE5;Z1-l`)29Q#Ev3%}1D8)U zi;sV>qf4Xl#|nHhAsoMDg~BA@tjcJf{U2@)>vDmhyO-4W%^7f@&4VP-FM9_idDWjP zm&WOh6!XkUFc}c9RRog(`;JFgL4F2}SdJRk1Tcqixp3D#J-?h}%zfdu>Ip~!j(q|J z#Km!eqGBVpIN%~E`=1Ko>+YP+p1|VpAaL-nINN}Ox+@$OH42Qu4llqMt3@Xs z14`hbbgWTv0dqXifTDER^O%F*xL`v=+_-T70@*kdn8VfhpfCibv8TX>o^fJA1(+FQ zQpWD+=pa*k$)f(@tOjIlQ(lEg?kCF$`D6O8G20u4q}F_w?l|9zwK|!*c89v}^>lTl zL?LxGcCEH?Xn=v-1~7RSrl5QZnF!EqTkKd-`xBZFB`n#pI;+{vY^q}6A-6)Xn8AdF zS?g$2(1}tks`ytnfgr#kv`abJ3A;EWJ2|wF!KmktV^ftoqIROeVL2_`Af9w-#_Q9JA;vmo$Pwdo3cyl_){1ct6N&}3B*0J!tyWoG(dyXj zr4pLwt=-aKTYA(J&b*`6~N9M2%l zh<5Ilw`k-ll}$SX$>tLAc+SRo%=!0XPF!*J2QS z$#YxN(1Tyi_Jlo4E$^qOCJ==VHSO5b(1RRHS>1-@io--M=rS<-bz(7s$muC~@9sot z;*t3+@sd^#q5uKL_AkgfNP!-yl=g&P^)h|1B5C55i*#lRbYbKQF=Vgz!ro)My}4>{ zL>lwTgx3HPK-6Y940!B7KyJHB%aE(92w?baXe8(`?4JXyyb@ihy>?J7_sPe>5^Pj^ z5BS#c>wR#q*@nu)T^+kf8%_drtb88?_EGV%?7x?*U?sDNt?!4zC5pZ$33MYJ$`G`j zqT=?uf?GxC2a$F`WR2saN_iDxc(e(k3OJhG1ojo*_~yWQC{-D(l@;wgG@eZ*yPP>` zqrFb$A1^X!D}OVn$O;j&oOGQ4cKS!=zj!oY2yuD>0a<)7Iwab&4Iua(2Rm@cYYkS& z@HZK3;ejtNSiuvrFL@2Lf$a(aHd@Ew`{x-9-K0r)4IqKM^MJqs#NxuB0p4rCz~QSG z2yF5A0s0&UilZ^RBc*^y#Ria8%34Sq9}z@wJCUQ91TWFSh3#MF{y=Ny(Ti2VLZ~+ zA^pMXhzd?AXYq?EStA!Rdiz>y;t^Rcd&1wQll$r7H9X(9 z`@4vx6Nu%S5xUPz&X^y*?K%xjw$&%SEPb%E{7AaQX592asRLofqqQ<4ojGlcI!98g znctDqa$-WV$^#boVO!+_K_}Tx9tl4^f!T~X7DK>w-X@G+4l7BUcnqkyB*AfbO&$Pj z@?6$UFwL@>ex__+zt&Y&Y{xfXEa(u`t5JY7@M4avRmy62loag4$v z|K-u?UQ?RWibtV*6fRiA61H@a_1dz=)N33rS+E#tYu-^Hz=FFlM;dqZlc(r$5WaNI|+$);WR+`$CpRaF_wi&Z-5j3%44L3emoL#7aB!^ zTgqx6M;9heVH3KRaU@$fF5|5U=aR{-%z~tESuTG~%WBPWrNW573NBw1Qh^LMS*6Y= zYJE23;kb46l?NF*sd)#q+{9wvs=HPj@=o&u3r8co)q=|t&qA@Hg4Jt#qL6ZLC}6c7 z_A2m&WNB9bs+)TPoI4CORJU!_9gFQ66u8j(ykQvB{jeDdJ6aDJ;twas_(%oABx!d>7k%| z=Or*hYY&HF>D`sU4B-`a>JWuu2?pP}-JzgE*1#o4I}}UECVR=X4#hI?L_<*oD?w1% zTld*NaH9_YxXUnu4cv7?H47iGds?h1&=zRYj=-R{0a~;X-}eMGX*$A-`mVL{`JY++ z_DXl`S>6AbZyvOHW>gE7{e(9l1AOJc0YB0Akst=83lBIBw>L73TL30QufMd&CeQIJ z{AoM0U4;opZ?hH?P#VV-nZT0Suge4!%**ObK=}eUFT^@c3w+&|9zx2Mij+33aZ`yY zi4&SuCGWJ&k>!EYo-B~0{Jl9nqNnxnlqUxnVv{#NN>)+wFqG_5-ZPNl((=Qu5cSG& z%RpwfKEe>7RW^yofK)V%_Op%{sow$x2@If+@87CuOY+*58h2}kSfzqcK%!co<6Vey zeHqqH=`B25`tHw@H-ur6xL;0W_)rTeD*6G_rbu`VK;HMQOVQIf9IDG=22EztR?IfX zNuJ99y8MpjIbG$j8u3LY-wl#0$^=>ow#0Ys8&y$Cc}^CslvA3%N&QAC5yOev zS(LHbIYwjzzVb(8lNr8O7=VX~aZwe-4}LAjR-ne4v?DO6Wyuz8WKrk@v{^Qm-^@3d z+qzhq=oFJ;-7Vhxqe66~7Sq&5+Gbd>UHQ(mj|OdoS2+%KX1FyjQ+&yiq^()dzfPcy zZ3EKfj8K9R-Z3?xn7fq?Kxw+PBQTv`%?~S84`g*DLJ|g)8^pm`&h*6x@7UcX?oKT( zz;7(y8_hih(x$u$k;pwKZ3$o7&4M9Ou9kH)n6Z3Dz&3)=j#XRM$3=6;RhQ$ll+X_< zFEMe^sG7G~vu#m|Z)mmUzL;vV(s9-N!0F(sq`4J-(8c#q?qJ&#|!6mPF_mkga)CxaO``hvNY~ZET57)d$iwr2rJo z3lJ&+cc++fbL?|43OMHW7@~@~M1HWNjBB+wh4E5I=UL34$&38r4|aU&IL3?bOp&y| z7`v!D6RH;6>4ZnX$V8eH% sOua&<9f3*YS_|y4DoaevYhAV!?Q=LQ7K-3dbQE$u$A;$r0dh;u7|-a?KL7v# literal 0 HcmV?d00001 diff --git a/docs/mkdocs_site/reference/SUMMARY/index.html b/docs/mkdocs_site/reference/SUMMARY/index.html new file mode 100644 index 00000000..c99e90e6 --- /dev/null +++ b/docs/mkdocs_site/reference/SUMMARY/index.html @@ -0,0 +1,2368 @@ + + + + + + + + + + + + + + + + + + SUMMARY - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/enums/index.html b/docs/mkdocs_site/reference/omnipy/api/enums/index.html new file mode 100644 index 00000000..920b7f55 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/enums/index.html @@ -0,0 +1,3548 @@ + + + + + + + + + + + + + + + + + + + + + + enums - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

enums

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ ConfigPersistOutputsOptions + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
21
+22
+23
+24
+25
class ConfigPersistOutputsOptions(str, Enum):
+    """"""
+    DISABLED = 'disabled'
+    ENABLE_FLOW_OUTPUTS = 'flow'
+    ENABLE_FLOW_AND_TASK_OUTPUTS = 'all'
+
+
+ + + +
+ + + + + + + +
+ + + +

+DISABLED = 'disabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ENABLE_FLOW_AND_TASK_OUTPUTS = 'all' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ENABLE_FLOW_OUTPUTS = 'flow' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ ConfigRestoreOutputsOptions + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
28
+29
+30
+31
class ConfigRestoreOutputsOptions(str, Enum):
+    """"""
+    DISABLED = 'disabled'
+    AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params'
+
+
+ + + +
+ + + + + + + +
+ + + +

+AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+DISABLED = 'disabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ EngineChoice + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
34
+35
+36
+37
class EngineChoice(str, Enum):
+    """"""
+    LOCAL = 'local'
+    PREFECT = 'prefect'
+
+
+ + + +
+ + + + + + + +
+ + + +

+LOCAL = 'local' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+PREFECT = 'prefect' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ PersistOutputsOptions + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
 6
+ 7
+ 8
+ 9
+10
class PersistOutputsOptions(str, Enum):
+    """"""
+    DISABLED = 'disabled'
+    FOLLOW_CONFIG = 'config'
+    ENABLED = 'enabled'
+
+
+ + + +
+ + + + + + + +
+ + + +

+DISABLED = 'disabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ENABLED = 'enabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+FOLLOW_CONFIG = 'config' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ RestoreOutputsOptions + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
13
+14
+15
+16
+17
+18
class RestoreOutputsOptions(str, Enum):
+    """"""
+    DISABLED = 'disabled'
+    FOLLOW_CONFIG = 'config'
+    AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params'
+    FORCE_ENABLE_IGNORE_PARAMS = 'force_ignore_params'
+
+
+ + + +
+ + + + + + + +
+ + + +

+AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+DISABLED = 'disabled' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+FOLLOW_CONFIG = 'config' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+FORCE_ENABLE_IGNORE_PARAMS = 'force_ignore_params' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ RunState + + +

+ + +
+

+ Bases: IntEnum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
40
+41
+42
+43
+44
class RunState(IntEnum):
+    """"""
+    INITIALIZED = 1
+    RUNNING = 2
+    FINISHED = 3
+
+
+ + + +
+ + + + + + + +
+ + + +

+FINISHED = 3 + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+INITIALIZED = 1 + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+RUNNING = 2 + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ RunStateLogMessages + + +

+ + +
+

+ Bases: str, Enum

+ + + + + +
+ Source code in src/omnipy/api/enums.py +
52
+53
+54
+55
+56
class RunStateLogMessages(str, Enum):
+    """"""
+    INITIALIZED = 'Initialized "{}"'
+    RUNNING = 'Started running "{}"...'
+    FINISHED = 'Finished running "{}"!'
+
+
+ + + +
+ + + + + + + +
+ + + +

+FINISHED = 'Finished running "{}"!' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+INITIALIZED = 'Initialized "{}"' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+RUNNING = 'Started running "{}"...' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/exceptions/index.html b/docs/mkdocs_site/reference/omnipy/api/exceptions/index.html new file mode 100644 index 00000000..03cc92f8 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/exceptions/index.html @@ -0,0 +1,2360 @@ + + + + + + + + + + + + + + + + + + + + + + exceptions - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

exceptions

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ JobStateException + + +

+ + +
+

+ Bases: Exception

+ + + +
+ Source code in src/omnipy/api/exceptions.py +
4
+5
class JobStateException(Exception):
+    ...
+
+
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/index.html b/docs/mkdocs_site/reference/omnipy/api/index.html new file mode 100644 index 00000000..d24be656 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/index.html @@ -0,0 +1,2280 @@ + + + + + + + + + + + + + + + + + + + + + + api - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

api

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/index.html new file mode 100644 index 00000000..334d5113 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/index.html @@ -0,0 +1,2282 @@ + + + + + + + + + + + + + + + + + + + + + + protocols - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

protocols

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/index.html new file mode 100644 index 00000000..56f691c8 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/index.html @@ -0,0 +1,2286 @@ + + + + + + + + + + + + + + + + + + + + + + compute - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

compute

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/job/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/job/index.html new file mode 100644 index 00000000..17d4adb3 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/job/index.html @@ -0,0 +1,4569 @@ + + + + + + + + + + + + + + + + + + + + + + job - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

job

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsFuncArgJob + + +

+ + +
+

+ Bases: IsFuncArgJobBase, Protocol[JobT]

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
150
+151
+152
+153
class IsFuncArgJob(IsFuncArgJobBase, Protocol[JobT]):
+    """"""
+    def revise(self) -> JobT:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+revise() + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
152
+153
def revise(self) -> JobT:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsFuncArgJobBase + + +

+ + +
+

+ Bases: IsJob, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
class IsFuncArgJobBase(IsJob, Protocol):
+    """"""
+    @property
+    def param_signatures(self) -> MappingProxyType:
+        ...
+
+    @property
+    def return_type(self) -> Type[object]:
+        ...
+
+    @property
+    def iterate_over_data_files(self) -> bool:
+        ...
+
+    @property
+    def persist_outputs(self) -> Optional[PersistOutputsOptions]:
+        ...
+
+    @property
+    def restore_outputs(self) -> Optional[RestoreOutputsOptions]:
+        ...
+
+    @property
+    def will_persist_outputs(self) -> PersistOutputsOptions:
+        ...
+
+    @property
+    def will_restore_outputs(self) -> RestoreOutputsOptions:
+        ...
+
+    @property
+    def result_key(self) -> Optional[str]:
+        ...
+
+    @property
+    def fixed_params(self) -> MappingProxyType[str, object]:
+        ...
+
+    @property
+    def param_key_map(self) -> MappingProxyType[str, str]:
+        ...
+
+    def has_coroutine_func(self) -> bool:
+        ...
+
+    def get_call_args(self, *args: object, **kwargs: object) -> Dict[str, object]:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+fixed_params: MappingProxyType[str, object] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+iterate_over_data_files: bool + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+param_key_map: MappingProxyType[str, str] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+param_signatures: MappingProxyType + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+persist_outputs: Optional[PersistOutputsOptions] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+restore_outputs: Optional[RestoreOutputsOptions] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+result_key: Optional[str] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+return_type: Type[object] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+will_persist_outputs: PersistOutputsOptions + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+will_restore_outputs: RestoreOutputsOptions + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+get_call_args(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
138
+139
def get_call_args(self, *args: object, **kwargs: object) -> Dict[str, object]:
+    ...
+
+
+
+ +
+ +
+ + + +

+has_coroutine_func() + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
135
+136
def has_coroutine_func(self) -> bool:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsFuncArgJobTemplate + + +

+ + +
+

+ Bases: IsJobTemplate, IsFuncArgJobBase, Protocol[JobTemplateT, JobT]

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
class IsFuncArgJobTemplate(IsJobTemplate, IsFuncArgJobBase, Protocol[JobTemplateT, JobT]):
+    """"""
+    def refine(self,
+               *args: Any,
+               update: bool = True,
+               name: Optional[str] = None,
+               iterate_over_data_files: bool = False,
+               persist_outputs: Optional[PersistOutputsOptions] = None,
+               restore_outputs: Optional[RestoreOutputsOptions] = None,
+               result_key: Optional[str] = None,
+               fixed_params: Optional[Mapping[str, object]] = None,
+               param_key_map: Optional[Mapping[str, str]] = None,
+               **kwargs: object) -> JobTemplateT:
+        ...
+
+    def apply(self) -> JobT:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply() + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
187
+188
def apply(self) -> JobT:
+    ...
+
+
+
+ +
+ +
+ + + +

+refine(*args, update=True, name=None, iterate_over_data_files=False, persist_outputs=None, restore_outputs=None, result_key=None, fixed_params=None, param_key_map=None, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
def refine(self,
+           *args: Any,
+           update: bool = True,
+           name: Optional[str] = None,
+           iterate_over_data_files: bool = False,
+           persist_outputs: Optional[PersistOutputsOptions] = None,
+           restore_outputs: Optional[RestoreOutputsOptions] = None,
+           result_key: Optional[str] = None,
+           fixed_params: Optional[Mapping[str, object]] = None,
+           param_key_map: Optional[Mapping[str, str]] = None,
+           **kwargs: object) -> JobTemplateT:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsFuncArgJobTemplateCallable + + +

+ + +
+

+ Bases: Protocol[JobTemplateT]

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
class IsFuncArgJobTemplateCallable(Protocol[JobTemplateT]):
+    """"""
+    def __call__(
+        self,
+        name: Optional[str] = None,
+        iterate_over_data_files: bool = False,
+        persist_outputs: Optional[PersistOutputsOptions] = None,
+        restore_outputs: Optional[RestoreOutputsOptions] = None,
+        result_key: Optional[str] = None,
+        fixed_params: Optional[Mapping[str, object]] = None,
+        param_key_map: Optional[Mapping[str, str]] = None,
+        **kwargs: object,
+    ) -> Callable[[Callable], JobTemplateT]:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__call__(name=None, iterate_over_data_files=False, persist_outputs=None, restore_outputs=None, result_key=None, fixed_params=None, param_key_map=None, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
def __call__(
+    self,
+    name: Optional[str] = None,
+    iterate_over_data_files: bool = False,
+    persist_outputs: Optional[PersistOutputsOptions] = None,
+    restore_outputs: Optional[RestoreOutputsOptions] = None,
+    result_key: Optional[str] = None,
+    fixed_params: Optional[Mapping[str, object]] = None,
+    param_key_map: Optional[Mapping[str, str]] = None,
+    **kwargs: object,
+) -> Callable[[Callable], JobTemplateT]:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsJob + + +

+ + +
+

+ Bases: IsJobBase, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
class IsJob(IsJobBase, Protocol):
+    """"""
+    @property
+    def time_of_cur_toplevel_flow_run(self) -> Optional[datetime]:
+        ...
+
+    @classmethod
+    def create_job(cls, *args: object, **kwargs: object) -> IsJob:
+        ...
+
+    def __call__(self, *args: object, **kwargs: object) -> object:
+        ...
+
+    def _apply_engine_decorator(self, engine: IsEngine) -> None:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+time_of_cur_toplevel_flow_run: Optional[datetime] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__call__(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
76
+77
def __call__(self, *args: object, **kwargs: object) -> object:
+    ...
+
+
+
+ +
+ +
+ + + +

+create_job(*args, **kwargs) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
72
+73
+74
@classmethod
+def create_job(cls, *args: object, **kwargs: object) -> IsJob:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsJobBase + + +

+ + +
+

+ Bases: CanLog, IsUniquelyNamedJob, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
class IsJobBase(CanLog, IsUniquelyNamedJob, Protocol):
+    """"""
+    @property
+    def _job_creator(self) -> IsJobCreator:
+        ...
+
+    @property
+    def config(self) -> Optional[IsJobConfigBase]:
+        ...
+
+    @property
+    def engine(self) -> Optional[IsEngine]:
+        ...
+
+    @property
+    def in_flow_context(self) -> bool:
+        ...
+
+    def __eq__(self, other: object):
+        ...
+
+    @classmethod
+    def _create_job_template(cls, *args: object, **kwargs: object) -> IsJobTemplate:
+        ...
+
+    @classmethod
+    def _create_job(cls, *args: object, **kwargs: object) -> IsJob:
+        ...
+
+    def _apply(self) -> IsJob:
+        ...
+
+    def _refine(self, *args: Any, update: bool = True, **kwargs: object) -> IsJobTemplate:
+        ...
+
+    def _revise(self) -> IsJobTemplate:
+        ...
+
+    def _call_job_template(self, *args: object, **kwargs: object) -> object:
+        ...
+
+    def _call_job(self, *args: object, **kwargs: object) -> object:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+config: Optional[IsJobConfigBase] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+engine: Optional[IsEngine] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+in_flow_context: bool + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__eq__(other) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
39
+40
def __eq__(self, other: object):
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsJobTemplate + + +

+ + +
+

+ Bases: IsJobBase, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
83
+84
+85
+86
+87
+88
+89
+90
class IsJobTemplate(IsJobBase, Protocol):
+    """"""
+    @classmethod
+    def create_job_template(cls, *args: object, **kwargs: object) -> IsJobTemplate:
+        ...
+
+    def run(self, *args: object, **kwargs: object) -> object:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+create_job_template(*args, **kwargs) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
85
+86
+87
@classmethod
+def create_job_template(cls, *args: object, **kwargs: object) -> IsJobTemplate:
+    ...
+
+
+
+ +
+ +
+ + + +

+run(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
89
+90
def run(self, *args: object, **kwargs: object) -> object:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsPlainFuncArgJobBase + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
142
+143
+144
+145
+146
+147
class IsPlainFuncArgJobBase(Protocol):
+    """"""
+    _job_func: Callable
+
+    def _accept_call_func_decorator(self, call_func_decorator: GeneralDecorator) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ IsTaskTemplateArgsJob + + +

+ + +
+

+ Bases: IsTaskTemplateArgsJobBase[TaskTemplateCovT], IsFuncArgJob[JobT], Protocol[TaskTemplateCovT, JobT]

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
198
+199
+200
+201
class IsTaskTemplateArgsJob(IsTaskTemplateArgsJobBase[TaskTemplateCovT],
+                            IsFuncArgJob[JobT],
+                            Protocol[TaskTemplateCovT, JobT]):
+    """"""
+
+
+ +
+ +
+ +
+ + + +

+ IsTaskTemplateArgsJobBase + + +

+ + +
+

+ Bases: IsFuncArgJobBase, Protocol[TaskTemplateCovT]

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
191
+192
+193
+194
+195
class IsTaskTemplateArgsJobBase(IsFuncArgJobBase, Protocol[TaskTemplateCovT]):
+    """"""
+    @property
+    def task_templates(self) -> Tuple[TaskTemplateCovT, ...]:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+task_templates: Tuple[TaskTemplateCovT, ...] + + + property + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ IsTaskTemplateArgsJobTemplate + + +

+ + +
+

+ Bases: IsFuncArgJobTemplate[JobTemplateT, JobT], IsTaskTemplateArgsJobBase[TaskTemplateT], Protocol[TaskTemplateT, JobTemplateT, JobT]

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
class IsTaskTemplateArgsJobTemplate(IsFuncArgJobTemplate[JobTemplateT, JobT],
+                                    IsTaskTemplateArgsJobBase[TaskTemplateT],
+                                    Protocol[TaskTemplateT, JobTemplateT, JobT]):
+    """"""
+    def refine(self,
+               *task_templates: TaskTemplateT,
+               update: bool = True,
+               name: Optional[str] = None,
+               iterate_over_data_files: bool = False,
+               fixed_params: Optional[Mapping[str, object]] = None,
+               param_key_map: Optional[Mapping[str, str]] = None,
+               result_key: Optional[str] = None,
+               persist_outputs: Optional[PersistOutputsOptions] = None,
+               restore_outputs: Optional[RestoreOutputsOptions] = None,
+               **kwargs: object) -> JobTemplateT:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+refine(*task_templates, update=True, name=None, iterate_over_data_files=False, fixed_params=None, param_key_map=None, result_key=None, persist_outputs=None, restore_outputs=None, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
def refine(self,
+           *task_templates: TaskTemplateT,
+           update: bool = True,
+           name: Optional[str] = None,
+           iterate_over_data_files: bool = False,
+           fixed_params: Optional[Mapping[str, object]] = None,
+           param_key_map: Optional[Mapping[str, str]] = None,
+           result_key: Optional[str] = None,
+           persist_outputs: Optional[PersistOutputsOptions] = None,
+           restore_outputs: Optional[RestoreOutputsOptions] = None,
+           **kwargs: object) -> JobTemplateT:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsTaskTemplateArgsJobTemplateCallable + + +

+ + +
+

+ Bases: Protocol[TaskTemplateContraT, JobTemplateT]

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
class IsTaskTemplateArgsJobTemplateCallable(Protocol[TaskTemplateContraT, JobTemplateT]):
+    """"""
+    def __call__(
+        self,
+        *task_templates: TaskTemplateContraT,
+        name: Optional[str] = None,
+        iterate_over_data_files: bool = False,
+        persist_outputs: Optional[PersistOutputsOptions] = None,
+        restore_outputs: Optional[RestoreOutputsOptions] = None,
+        result_key: Optional[str] = None,
+        fixed_params: Optional[Mapping[str, object]] = None,
+        param_key_map: Optional[Mapping[str, str]] = None,
+        **kwargs: object,
+    ) -> Callable[[Callable], JobTemplateT]:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__call__(*task_templates, name=None, iterate_over_data_files=False, persist_outputs=None, restore_outputs=None, result_key=None, fixed_params=None, param_key_map=None, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job.py +
206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
def __call__(
+    self,
+    *task_templates: TaskTemplateContraT,
+    name: Optional[str] = None,
+    iterate_over_data_files: bool = False,
+    persist_outputs: Optional[PersistOutputsOptions] = None,
+    restore_outputs: Optional[RestoreOutputsOptions] = None,
+    result_key: Optional[str] = None,
+    fixed_params: Optional[Mapping[str, object]] = None,
+    param_key_map: Optional[Mapping[str, str]] = None,
+    **kwargs: object,
+) -> Callable[[Callable], JobTemplateT]:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/job_creator/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/job_creator/index.html new file mode 100644 index 00000000..03581925 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/job_creator/index.html @@ -0,0 +1,2715 @@ + + + + + + + + + + + + + + + + + + + + + + job_creator - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

job_creator

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsJobConfigHolder + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job_creator.py +
11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
class IsJobConfigHolder(Protocol):
+    """"""
+    @property
+    def config(self) -> Optional[IsJobConfigBase]:
+        ...
+
+    @property
+    def engine(self) -> Optional[IsEngine]:
+        ...
+
+    def set_config(self, config: IsJobConfigBase) -> None:
+        ...
+
+    def set_engine(self, engine: IsEngine) -> None:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+config: Optional[IsJobConfigBase] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+engine: Optional[IsEngine] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+set_config(config) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job_creator.py +
21
+22
def set_config(self, config: IsJobConfigBase) -> None:
+    ...
+
+
+
+ +
+ +
+ + + +

+set_engine(engine) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/job_creator.py +
24
+25
def set_engine(self, engine: IsEngine) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsJobCreator + + +

+ + +
+

+ Bases: IsNestedContext, IsJobConfigHolder, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/job_creator.py +
28
+29
+30
+31
+32
+33
+34
+35
+36
class IsJobCreator(IsNestedContext, IsJobConfigHolder, Protocol):
+    """"""
+    @property
+    def nested_context_level(self) -> int:
+        ...
+
+    @property
+    def time_of_cur_toplevel_nested_context_run(self) -> Optional[datetime]:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+nested_context_level: int + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+time_of_cur_toplevel_nested_context_run: Optional[datetime] + + + property + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/mixins/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/mixins/index.html new file mode 100644 index 00000000..93db9156 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/compute/mixins/index.html @@ -0,0 +1,2719 @@ + + + + + + + + + + + + + + + + + + + + + + mixins - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

mixins

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsNestedContext + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/mixins.py +
23
+24
+25
+26
+27
+28
+29
class IsNestedContext(Protocol):
+    """"""
+    def __enter__(self):
+        ...
+
+    def __exit__(self, exc_type, exc_value, traceback):
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__enter__() + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/mixins.py +
25
+26
def __enter__(self):
+    ...
+
+
+
+ +
+ +
+ + + +

+__exit__(exc_type, exc_value, traceback) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/mixins.py +
28
+29
def __exit__(self, exc_type, exc_value, traceback):
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsUniquelyNamedJob + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/compute/mixins.py +
 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
class IsUniquelyNamedJob(Protocol):
+    """"""
+    @property
+    def name(self) -> str:
+        ...
+
+    @property
+    def unique_name(self) -> str:
+        ...
+
+    def __init__(self, *, name: Optional[str] = None):
+        ...
+
+    def regenerate_unique_name(self) -> None:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+name: str + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+unique_name: str + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(*, name=None) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/mixins.py +
16
+17
def __init__(self, *, name: Optional[str] = None):
+    ...
+
+
+
+ +
+ +
+ + + +

+regenerate_unique_name() + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/compute/mixins.py +
19
+20
def regenerate_unique_name(self) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/config/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/config/index.html new file mode 100644 index 00000000..18fff08e --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/config/index.html @@ -0,0 +1,2499 @@ + + + + + + + + + + + + + + + + + + + + + + config - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

config

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsJobConfigBase + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/config.py +
 8
+ 9
+10
+11
+12
class IsJobConfigBase(Protocol):
+    """"""
+    persist_outputs: ConfigPersistOutputsOptions
+    restore_outputs: ConfigRestoreOutputsOptions
+    persist_data_dir_path: str
+
+
+ + + +
+ + + + + + + +
+ + + +

+persist_data_dir_path: str + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+persist_outputs: ConfigPersistOutputsOptions + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+restore_outputs: ConfigRestoreOutputsOptions + + + instance-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/engine/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/engine/index.html new file mode 100644 index 00000000..6a5b84f4 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/engine/index.html @@ -0,0 +1,2621 @@ + + + + + + + + + + + + + + + + + + + + + + engine - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

engine

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsEngine + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/engine.py +
 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
@runtime_checkable
+class IsEngine(Protocol):
+    """"""
+    def __init__(self) -> None:
+        ...
+
+    @classmethod
+    def get_config_cls(cls) -> Type[IsEngineConfig]:
+        ...
+
+    def set_config(self, config: IsEngineConfig) -> None:
+        ...
+
+    def set_registry(self, registry: Optional[IsRunStateRegistry]) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__init__() + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/engine.py +
11
+12
def __init__(self) -> None:
+    ...
+
+
+
+ +
+ +
+ + + +

+get_config_cls() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/engine.py +
14
+15
+16
@classmethod
+def get_config_cls(cls) -> Type[IsEngineConfig]:
+    ...
+
+
+
+ +
+ +
+ + + +

+set_config(config) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/engine.py +
18
+19
def set_config(self, config: IsEngineConfig) -> None:
+    ...
+
+
+
+ +
+ +
+ + + +

+set_registry(registry) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/engine.py +
21
+22
def set_registry(self, registry: Optional[IsRunStateRegistry]) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsEngineConfig + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/engine.py +
25
+26
+27
class IsEngineConfig(Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/index.html new file mode 100644 index 00000000..c5267dc5 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/index.html @@ -0,0 +1,2284 @@ + + + + + + + + + + + + + + + + + + + + + + private - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

private

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/log/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/log/index.html new file mode 100644 index 00000000..51738211 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/log/index.html @@ -0,0 +1,2762 @@ + + + + + + + + + + + + + + + + + + + + + + log - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

log

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ CanLog + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/log.py +
11
+12
+13
+14
+15
+16
+17
+18
class CanLog(Protocol):
+    """"""
+    @property
+    def logger(self) -> Logger:
+        ...
+
+    def log(self, log_msg: str, level: int = INFO, datetime_obj: Optional[datetime] = None):
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+logger: Logger + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+log(log_msg, level=INFO, datetime_obj=None) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/log.py +
17
+18
def log(self, log_msg: str, level: int = INFO, datetime_obj: Optional[datetime] = None):
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsRunStateRegistry + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/log.py +
21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
class IsRunStateRegistry(Protocol):
+    """"""
+    def __init__(self) -> None:
+        ...
+
+    def get_job_state(self, job: IsUniquelyNamedJob) -> RunState:
+        ...
+
+    def get_job_state_datetime(self, job: IsUniquelyNamedJob, state: RunState) -> datetime:
+        ...
+
+    def all_jobs(self, state: Optional[RunState] = None) -> Tuple[IsUniquelyNamedJob, ...]:  # noqa
+        ...
+
+    def set_job_state(self, job: IsUniquelyNamedJob, state: RunState) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__init__() + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/log.py +
23
+24
def __init__(self) -> None:
+    ...
+
+
+
+ +
+ +
+ + + +

+all_jobs(state=None) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/log.py +
32
+33
def all_jobs(self, state: Optional[RunState] = None) -> Tuple[IsUniquelyNamedJob, ...]:  # noqa
+    ...
+
+
+
+ +
+ +
+ + + +

+get_job_state(job) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/log.py +
26
+27
def get_job_state(self, job: IsUniquelyNamedJob) -> RunState:
+    ...
+
+
+
+ +
+ +
+ + + +

+get_job_state_datetime(job, state) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/log.py +
29
+30
def get_job_state_datetime(self, job: IsUniquelyNamedJob, state: RunState) -> datetime:
+    ...
+
+
+
+ +
+ +
+ + + +

+set_job_state(job, state) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/log.py +
35
+36
def set_job_state(self, job: IsUniquelyNamedJob, state: RunState) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/private/util/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/private/util/index.html new file mode 100644 index 00000000..9c61466d --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/private/util/index.html @@ -0,0 +1,2553 @@ + + + + + + + + + + + + + + + + + + + + + + util - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

util

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsCallableClass + + +

+ + +
+

+ Bases: Protocol[DecoratorClassT]

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/util.py +
15
+16
+17
+18
+19
@runtime_checkable
+class IsCallableClass(Protocol[DecoratorClassT]):
+    """"""
+    def __call__(self, *args: object, **kwargs: object) -> Callable[[Callable], DecoratorClassT]:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__call__(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/util.py +
18
+19
def __call__(self, *args: object, **kwargs: object) -> Callable[[Callable], DecoratorClassT]:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsCallableParamAfterSelf + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/private/util.py +
 8
+ 9
+10
+11
+12
@runtime_checkable
+class IsCallableParamAfterSelf(Protocol):
+    """"""
+    def __call__(self, callable_arg: Callable, /, *args: object, **kwargs: object) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__call__(callable_arg, /, *args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/private/util.py +
11
+12
def __call__(self, callable_arg: Callable, /, *args: object, **kwargs: object) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/public/compute/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/public/compute/index.html new file mode 100644 index 00000000..1efabf77 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/public/compute/index.html @@ -0,0 +1,2917 @@ + + + + + + + + + + + + + + + + + + + + + + compute - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

compute

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsDagFlow + + +

+ + +
+

+ Bases: IsTaskTemplateArgsJob[IsTaskTemplate, IsDagFlowTemplate], IsFlow, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
62
+63
+64
class IsDagFlow(IsTaskTemplateArgsJob[IsTaskTemplate, IsDagFlowTemplate], IsFlow, Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsDagFlowTemplate + + +

+ + +
+

+ Bases: IsTaskTemplateArgsJobTemplate[IsTaskTemplate, IsDagFlowTemplate, IsDagFlow], IsFlowTemplate, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
53
+54
+55
+56
+57
+58
+59
class IsDagFlowTemplate(IsTaskTemplateArgsJobTemplate[IsTaskTemplate,
+                                                      'IsDagFlowTemplate',
+                                                      'IsDagFlow'],
+                        IsFlowTemplate,
+                        Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsFlow + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
28
+29
+30
+31
+32
+33
+34
+35
+36
class IsFlow(Protocol):
+    """"""
+    @property
+    def flow_context(self) -> IsNestedContext:
+        ...
+
+    @property
+    def time_of_last_run(self) -> Optional[datetime]:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+flow_context: IsNestedContext + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+time_of_last_run: Optional[datetime] + + + property + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ IsFlowTemplate + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
23
+24
+25
class IsFlowTemplate(Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsFuncFlow + + +

+ + +
+

+ Bases: IsFuncArgJob[IsFuncFlowTemplate], Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
74
+75
+76
class IsFuncFlow(IsFuncArgJob[IsFuncFlowTemplate], Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsFuncFlowTemplate + + +

+ + +
+

+ Bases: IsFuncArgJobTemplate[IsFuncFlowTemplate, IsFuncFlow], IsFlowTemplate, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
67
+68
+69
+70
+71
class IsFuncFlowTemplate(IsFuncArgJobTemplate['IsFuncFlowTemplate', 'IsFuncFlow'],
+                         IsFlowTemplate,
+                         Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsLinearFlow + + +

+ + +
+

+ Bases: IsTaskTemplateArgsJob[IsTaskTemplate, IsLinearFlowTemplate], IsFlow, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
48
+49
+50
class IsLinearFlow(IsTaskTemplateArgsJob[IsTaskTemplate, IsLinearFlowTemplate], IsFlow, Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsLinearFlowTemplate + + +

+ + +
+

+ Bases: IsTaskTemplateArgsJobTemplate[IsTaskTemplate, IsLinearFlowTemplate, IsLinearFlow], IsFlowTemplate, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
39
+40
+41
+42
+43
+44
+45
class IsLinearFlowTemplate(IsTaskTemplateArgsJobTemplate[IsTaskTemplate,
+                                                         'IsLinearFlowTemplate',
+                                                         'IsLinearFlow'],
+                           IsFlowTemplate,
+                           Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsTask + + +

+ + +
+

+ Bases: IsFuncArgJob[IsTaskTemplate], Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
18
+19
+20
class IsTask(IsFuncArgJob[IsTaskTemplate], Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsTaskTemplate + + +

+ + +
+

+ Bases: IsFuncArgJobTemplate[IsTaskTemplate, IsTask], Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/compute.py +
13
+14
+15
class IsTaskTemplate(IsFuncArgJobTemplate['IsTaskTemplate', 'IsTask'], Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/public/config/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/public/config/index.html new file mode 100644 index 00000000..db07f205 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/public/config/index.html @@ -0,0 +1,2912 @@ + + + + + + + + + + + + + + + + + + + + + + config - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

config

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsJobConfig + + +

+ + +
+

+ Bases: IsJobConfigBase, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/config.py +
20
+21
+22
class IsJobConfig(IsJobConfigBase, Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsLocalRunnerConfig + + +

+ + +
+

+ Bases: IsEngineConfig, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/config.py +
10
+11
+12
class IsLocalRunnerConfig(IsEngineConfig, Protocol):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ IsPrefectEngineConfig + + +

+ + +
+

+ Bases: IsEngineConfig, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/config.py +
15
+16
+17
class IsPrefectEngineConfig(IsEngineConfig, Protocol):
+    """"""
+    use_cached_results: int = False
+
+
+ + + +
+ + + + + + + +
+ + + +

+use_cached_results: int = False + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ IsRootLogConfig + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/config.py +
25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
class IsRootLogConfig(Protocol):
+    """"""
+    log_format_str: str
+    locale: LocaleType
+    log_to_stdout: bool
+    log_to_stderr: bool
+    log_to_file: bool
+    stdout_log_min_level: int
+    stderr_log_min_level: int
+    file_log_min_level: int
+    file_log_dir_path: str
+
+
+ + + +
+ + + + + + + +
+ + + +

+file_log_dir_path: str + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+file_log_min_level: int + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+locale: LocaleType + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+log_format_str: str + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+log_to_file: bool + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+log_to_stderr: bool + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+log_to_stdout: bool + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+stderr_log_min_level: int + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+stdout_log_min_level: int + + + instance-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/public/engine/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/public/engine/index.html new file mode 100644 index 00000000..fe99159d --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/public/engine/index.html @@ -0,0 +1,2805 @@ + + + + + + + + + + + + + + + + + + + + + + engine - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+ +
+
+ + + +
+
+ + + + +

engine

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsDagFlowRunnerEngine + + +

+ + +
+

+ Bases: IsEngine, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/engine.py +
25
+26
+27
+28
+29
+30
@runtime_checkable
+class IsDagFlowRunnerEngine(IsEngine, Protocol):
+    """"""
+    def apply_dag_flow_decorator(self, dag_flow: IsDagFlow,
+                                 job_callback_accept_decorator: Callable) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply_dag_flow_decorator(dag_flow, job_callback_accept_decorator) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/engine.py +
28
+29
+30
def apply_dag_flow_decorator(self, dag_flow: IsDagFlow,
+                             job_callback_accept_decorator: Callable) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsFuncFlowRunnerEngine + + +

+ + +
+

+ Bases: IsEngine, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/engine.py +
33
+34
+35
+36
+37
+38
+39
@runtime_checkable
+class IsFuncFlowRunnerEngine(IsEngine, Protocol):
+    """"""
+    def apply_func_flow_decorator(self,
+                                  func_flow: IsFuncFlow,
+                                  job_callback_accept_decorator: Callable) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply_func_flow_decorator(func_flow, job_callback_accept_decorator) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/engine.py +
36
+37
+38
+39
def apply_func_flow_decorator(self,
+                              func_flow: IsFuncFlow,
+                              job_callback_accept_decorator: Callable) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsLinearFlowRunnerEngine + + +

+ + +
+

+ Bases: IsEngine, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/engine.py +
16
+17
+18
+19
+20
+21
+22
@runtime_checkable
+class IsLinearFlowRunnerEngine(IsEngine, Protocol):
+    """"""
+    def apply_linear_flow_decorator(self,
+                                    linear_flow: IsLinearFlow,
+                                    job_callback_accept_decorator: Callable) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply_linear_flow_decorator(linear_flow, job_callback_accept_decorator) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/engine.py +
19
+20
+21
+22
def apply_linear_flow_decorator(self,
+                                linear_flow: IsLinearFlow,
+                                job_callback_accept_decorator: Callable) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsTaskRunnerEngine + + +

+ + +
+

+ Bases: IsEngine, Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/engine.py +
 9
+10
+11
+12
+13
@runtime_checkable
+class IsTaskRunnerEngine(IsEngine, Protocol):
+    """"""
+    def apply_task_decorator(self, task: IsTask, job_callback_accept_decorator: Callable) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply_task_decorator(task, job_callback_accept_decorator) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/engine.py +
12
+13
def apply_task_decorator(self, task: IsTask, job_callback_accept_decorator: Callable) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/public/hub/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/public/hub/index.html new file mode 100644 index 00000000..e144ff4f --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/public/hub/index.html @@ -0,0 +1,3478 @@ + + + + + + + + + + + + + + + + + + + + + + hub - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

hub

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsRootLogObjects + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/hub.py +
17
+18
+19
+20
+21
+22
+23
+24
+25
class IsRootLogObjects(Protocol):
+    """"""
+    formatter: Optional[logging.Formatter] = None
+    stdout_handler: Optional[logging.StreamHandler] = None
+    stderr_handler: Optional[logging.StreamHandler] = None
+    file_handler: Optional[TimedRotatingFileHandler] = None
+
+    def set_config(self, config: IsRootLogConfig) -> None:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+file_handler: Optional[TimedRotatingFileHandler] = None + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+formatter: Optional[logging.Formatter] = None + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+stderr_handler: Optional[logging.StreamHandler] = None + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+stdout_handler: Optional[logging.StreamHandler] = None + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+set_config(config) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/hub.py +
24
+25
def set_config(self, config: IsRootLogConfig) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsRuntime + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/hub.py +
69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
class IsRuntime(Protocol):
+    """"""
+    config: IsRuntimeConfig
+    objects: IsRuntimeObjects
+
+    def __init__(
+            self,
+            config: Optional[IsRuntimeConfig] = None,  # noqa
+            objects: Optional[IsRuntimeObjects] = None,  # noqa
+            *args: Any,
+            **kwargs: Any) -> None:
+        ...
+
+    def reset_subscriptions(self):
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+config: IsRuntimeConfig + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+objects: IsRuntimeObjects + + + instance-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(config=None, objects=None, *args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/hub.py +
74
+75
+76
+77
+78
+79
+80
def __init__(
+        self,
+        config: Optional[IsRuntimeConfig] = None,  # noqa
+        objects: Optional[IsRuntimeObjects] = None,  # noqa
+        *args: Any,
+        **kwargs: Any) -> None:
+    ...
+
+
+
+ +
+ +
+ + + +

+reset_subscriptions() + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/hub.py +
82
+83
def reset_subscriptions(self):
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsRuntimeConfig + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/hub.py +
28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
class IsRuntimeConfig(Protocol):
+    """"""
+    job: IsJobConfig
+    engine: EngineChoice
+    local: IsLocalRunnerConfig
+    prefect: IsPrefectEngineConfig
+    root_log: IsRootLogConfig
+
+    def __init__(
+            self,
+            job: Optional[IsJobConfig] = None,  # noqa
+            engine: EngineChoice = EngineChoice.LOCAL,  # noqa
+            local: Optional[IsLocalRunnerConfig] = None,  # noqa
+            prefect: Optional[IsPrefectEngineConfig] = None,  # noqa
+            root_log: Optional[IsRootLogConfigEntryPublisher] = None,  # noqa
+            *args: Any,
+            **kwargs: Any) -> None:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+engine: EngineChoice + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+job: IsJobConfig + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+local: IsLocalRunnerConfig + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+prefect: IsPrefectEngineConfig + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+root_log: IsRootLogConfig + + + instance-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(job=None, engine=EngineChoice.LOCAL, local=None, prefect=None, root_log=None, *args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/hub.py +
36
+37
+38
+39
+40
+41
+42
+43
+44
+45
def __init__(
+        self,
+        job: Optional[IsJobConfig] = None,  # noqa
+        engine: EngineChoice = EngineChoice.LOCAL,  # noqa
+        local: Optional[IsLocalRunnerConfig] = None,  # noqa
+        prefect: Optional[IsPrefectEngineConfig] = None,  # noqa
+        root_log: Optional[IsRootLogConfigEntryPublisher] = None,  # noqa
+        *args: Any,
+        **kwargs: Any) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsRuntimeObjects + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/api/protocols/public/hub.py +
48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
class IsRuntimeObjects(Protocol):
+    """"""
+
+    job_creator: IsJobConfigHolder
+    local: IsEngine
+    prefect: IsEngine
+    registry: IsRunStateRegistry
+    root_log: IsRootLogObjects
+
+    def __init__(
+            self,
+            job_creator: Optional[IsJobConfigHolder] = None,  # noqa
+            local: Optional[IsEngine] = None,  # noqa
+            prefect: Optional[IsEngine] = None,  # noqa
+            registry: Optional[IsRunStateRegistry] = None,  # noqa
+            root_log: Optional[IsRootLogObjects] = None,  # noqa
+            *args: Any,
+            **kwargs: Any) -> None:
+        ...
+
+
+ + + +
+ + + + + + + +
+ + + +

+job_creator: IsJobConfigHolder + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+local: IsEngine + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+prefect: IsEngine + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+registry: IsRunStateRegistry + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+root_log: IsRootLogObjects + + + instance-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(job_creator=None, local=None, prefect=None, registry=None, root_log=None, *args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/api/protocols/public/hub.py +
57
+58
+59
+60
+61
+62
+63
+64
+65
+66
def __init__(
+        self,
+        job_creator: Optional[IsJobConfigHolder] = None,  # noqa
+        local: Optional[IsEngine] = None,  # noqa
+        prefect: Optional[IsEngine] = None,  # noqa
+        registry: Optional[IsRunStateRegistry] = None,  # noqa
+        root_log: Optional[IsRootLogObjects] = None,  # noqa
+        *args: Any,
+        **kwargs: Any) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/protocols/public/index.html b/docs/mkdocs_site/reference/omnipy/api/protocols/public/index.html new file mode 100644 index 00000000..45c22c15 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/protocols/public/index.html @@ -0,0 +1,2284 @@ + + + + + + + + + + + + + + + + + + + + + + public - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

public

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/api/types/index.html b/docs/mkdocs_site/reference/omnipy/api/types/index.html new file mode 100644 index 00000000..1468d9dc --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/api/types/index.html @@ -0,0 +1,2614 @@ + + + + + + + + + + + + + + + + + + + + + + types - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

types

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+DecoratorClassT = TypeVar('DecoratorClassT', covariant=True) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+GeneralDecorator = Callable[[Callable], Callable] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JobConfigT = TypeVar('JobConfigT', covariant=True) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JobT = TypeVar('JobT', covariant=True) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JobTemplateT = TypeVar('JobTemplateT', covariant=True) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+LocaleType: TypeAlias = Union[str, Tuple[Optional[str], Optional[str]]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+TaskTemplateContraT = TypeVar('TaskTemplateContraT', contravariant=True) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+TaskTemplateCovT = TypeVar('TaskTemplateCovT', covariant=True) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+TaskTemplateT = TypeVar('TaskTemplateT') + + + module-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/flow/index.html b/docs/mkdocs_site/reference/omnipy/compute/flow/index.html new file mode 100644 index 00000000..e7ab54ec --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/flow/index.html @@ -0,0 +1,2903 @@ + + + + + + + + + + + + + + + + + + + + + + flow - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

flow

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ DagFlow + + +

+ + +
+

+ Bases: JobMixin, FlowBase, TaskTemplateArgsJobBase

+ + + +
+ Source code in src/omnipy/compute/flow.py +
69
+70
+71
+72
+73
+74
+75
+76
+77
+78
class DagFlow(JobMixin, FlowBase, TaskTemplateArgsJobBase):
+    def _apply_engine_decorator(self, engine: IsEngine) -> None:
+        if self.engine:
+            engine = cast(IsDagFlowRunnerEngine, self.engine)
+            self_with_mixins = cast(IsDagFlow, self)
+            engine.apply_dag_flow_decorator(self_with_mixins, self._accept_call_func_decorator)
+
+    @classmethod
+    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:
+        return cast(Type[IsDagFlowTemplate], DagFlowTemplate)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ DagFlowTemplate + + +

+ + +
+

+ Bases: JobTemplateMixin, FlowBase, TaskTemplateArgsJobBase

+ + + +
+ Source code in src/omnipy/compute/flow.py +
62
+63
+64
+65
+66
@dag_flow_template_callable_decorator_cls
+class DagFlowTemplate(JobTemplateMixin, FlowBase, TaskTemplateArgsJobBase):
+    @classmethod
+    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:
+        return cast(Type[IsDagFlow], DagFlow)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ FlowBase + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/flow.py +
25
+26
class FlowBase:
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ FuncFlow + + +

+ + +
+

+ Bases: JobMixin, FlowBase, FuncArgJobBase

+ + + +
+ Source code in src/omnipy/compute/flow.py +
 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
class FuncFlow(JobMixin, FlowBase, FuncArgJobBase):
+    def _apply_engine_decorator(self, engine: IsEngine) -> None:
+        if self.engine:
+            engine = cast(IsFuncFlowRunnerEngine, self.engine)
+            self_with_mixins = cast(IsFuncFlow, self)
+            engine.apply_func_flow_decorator(self_with_mixins, self._accept_call_func_decorator)
+
+    @classmethod
+    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:
+        return cast(Type[IsFuncFlowTemplate], FuncFlowTemplate)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ FuncFlowTemplate + + +

+ + +
+

+ Bases: JobTemplateMixin, FlowBase, FuncArgJobBase

+ + + +
+ Source code in src/omnipy/compute/flow.py +
86
+87
+88
+89
+90
@func_flow_template_callable_decorator_cls
+class FuncFlowTemplate(JobTemplateMixin, FlowBase, FuncArgJobBase):
+    @classmethod
+    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:
+        return cast(Type[IsFuncFlow], FuncFlow)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ LinearFlow + + +

+ + +
+

+ Bases: JobMixin, FlowBase, TaskTemplateArgsJobBase

+ + + +
+ Source code in src/omnipy/compute/flow.py +
43
+44
+45
+46
+47
+48
+49
+50
+51
+52
class LinearFlow(JobMixin, FlowBase, TaskTemplateArgsJobBase):
+    def _apply_engine_decorator(self, engine: IsEngine) -> None:
+        if self.engine:
+            engine = cast(IsLinearFlowRunnerEngine, self.engine)
+            self_with_mixins = cast(IsLinearFlow, self)
+            engine.apply_linear_flow_decorator(self_with_mixins, self._accept_call_func_decorator)
+
+    @classmethod
+    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:
+        return cast(Type[IsLinearFlowTemplate], LinearFlowTemplate)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ LinearFlowTemplate + + +

+ + +
+

+ Bases: JobTemplateMixin, FlowBase, TaskTemplateArgsJobBase

+ + + +
+ Source code in src/omnipy/compute/flow.py +
36
+37
+38
+39
+40
@linear_flow_template_callable_decorator_cls
+class LinearFlowTemplate(JobTemplateMixin, FlowBase, TaskTemplateArgsJobBase):
+    @classmethod
+    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:
+        return cast(Type[IsLinearFlow], LinearFlow)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + +
+ + + +

+dag_flow_template_callable_decorator_cls(cls) + +

+ + +
+ +
+ Source code in src/omnipy/compute/flow.py +
55
+56
+57
+58
+59
def dag_flow_template_callable_decorator_cls(
+    cls: Type['DagFlowTemplate']
+) -> IsTaskTemplateArgsJobTemplateCallable[IsTaskTemplate, IsDagFlowTemplate]:
+    return cast(IsTaskTemplateArgsJobTemplateCallable[IsTaskTemplate, IsDagFlowTemplate],
+                callable_decorator_cls(cls))
+
+
+
+ +
+ +
+ + + +

+func_flow_template_callable_decorator_cls(cls) + +

+ + +
+ +
+ Source code in src/omnipy/compute/flow.py +
81
+82
+83
def func_flow_template_callable_decorator_cls(
+        cls: Type['FuncFlowTemplate']) -> IsFuncArgJobTemplateCallable[IsFuncFlowTemplate]:
+    return cast(IsFuncArgJobTemplateCallable[IsFuncFlowTemplate], callable_decorator_cls(cls))
+
+
+
+ +
+ +
+ + + +

+linear_flow_template_callable_decorator_cls(cls) + +

+ + +
+ +
+ Source code in src/omnipy/compute/flow.py +
29
+30
+31
+32
+33
def linear_flow_template_callable_decorator_cls(
+    cls: Type['LinearFlowTemplate']
+) -> IsTaskTemplateArgsJobTemplateCallable[IsTaskTemplate, IsLinearFlowTemplate]:
+    return cast(IsTaskTemplateArgsJobTemplateCallable[IsTaskTemplate, IsLinearFlowTemplate],
+                callable_decorator_cls(cls))
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/func_job/index.html b/docs/mkdocs_site/reference/omnipy/compute/func_job/index.html new file mode 100644 index 00000000..a8a10a2a --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/func_job/index.html @@ -0,0 +1,2549 @@ + + + + + + + + + + + + + + + + + + + + + + func_job - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

func_job

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ FuncArgJobBase + + +

+ + +
+

+ Bases: PlainFuncArgJobBase

+ + + +
+ Source code in src/omnipy/compute/func_job.py +
40
+41
class FuncArgJobBase(PlainFuncArgJobBase):
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ PlainFuncArgJobBase + + +

+ + +
+

+ Bases: JobBase

+ + + +
+ Source code in src/omnipy/compute/func_job.py +
13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
class PlainFuncArgJobBase(JobBase):
+    def __init__(self, job_func: Callable, *args: object, **kwargs: object) -> None:
+        self._job_func = job_func
+
+    def _get_init_args(self) -> Tuple[object, ...]:
+        return self._job_func,
+
+    def has_coroutine_func(self) -> bool:
+        return asyncio.iscoroutinefunction(self._job_func)
+
+    def _call_job(self, *args: object, **kwargs: object) -> object:
+        """To be overloaded by mixins"""
+        return self._call_func(*args, **kwargs)
+
+    def _call_func(self, *args: object, **kwargs: object) -> object:
+        """
+        To be decorated by job runners and mixins that need early application. Should not
+        be overloaded using inheritance. The method _accept_call_func_decorator accepts
+        decorators.
+        """
+        return self._job_func(*args, **kwargs)
+
+    def _accept_call_func_decorator(self, call_func_decorator: GeneralDecorator) -> None:
+        self._call_func = call_func_decorator(self._call_func)  # type:ignore
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__init__(job_func, *args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/func_job.py +
14
+15
def __init__(self, job_func: Callable, *args: object, **kwargs: object) -> None:
+    self._job_func = job_func
+
+
+
+ +
+ +
+ + + +

+has_coroutine_func() + +

+ + +
+ +
+ Source code in src/omnipy/compute/func_job.py +
20
+21
def has_coroutine_func(self) -> bool:
+    return asyncio.iscoroutinefunction(self._job_func)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/index.html b/docs/mkdocs_site/reference/omnipy/compute/index.html new file mode 100644 index 00000000..d720bb9e --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/index.html @@ -0,0 +1,2280 @@ + + + + + + + + + + + + + + + + + + + + + + compute - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

compute

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/job/index.html b/docs/mkdocs_site/reference/omnipy/compute/job/index.html new file mode 100644 index 00000000..f9ac620d --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/job/index.html @@ -0,0 +1,3608 @@ + + + + + + + + + + + + + + + + + + + + + + job - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

job

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ JobBase + + +

+ + +
+

+ Bases: LogMixin, DynamicMixinAcceptor

+ + + +
+ Source code in src/omnipy/compute/job.py +
 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
class JobBase(LogMixin, DynamicMixinAcceptor, metaclass=JobBaseMeta):
+    @property
+    def _job_creator(self) -> IsJobCreator:
+        return self.__class__.job_creator
+
+    @property
+    def config(self) -> Optional[IsJobConfig]:
+        return self.__class__.job_creator.config
+
+    @property
+    def engine(self) -> Optional[IsEngine]:
+        return self.__class__.job_creator.engine
+
+    @property
+    def in_flow_context(self) -> bool:
+        return self.__class__.nested_context_level > 0
+
+    def __init__(self, *args: object, **kwargs: object):
+        # super().__init__()
+
+        # TODO: refactor using state machine
+
+        if not isinstance(self, JobTemplateMixin) and not isinstance(self, JobMixin):
+            raise JobStateException('JobBase and subclasses not inheriting from JobTemplateMixin '
+                                    'or JobMixin are not directly instantiatable')
+
+        from_apply = hasattr(self, '_from_apply') and self._from_apply is True
+        if isinstance(self, JobMixin) and not from_apply:
+            raise JobStateException(
+                'JobMixin should only be instantiated using the "apply()" method of '
+                'an instance of JobTemplateMixin (or one of its subclasses)')
+
+    @classmethod
+    def _create_job_template(cls, *args: object, **kwargs: object) -> IsJobTemplate:
+        if len(args) >= 1:
+            cls_as_callable_class = cast(Type[IsCallableClass], cls)
+
+            if not callable(args[0]):
+                raise TypeError(f'First argument of a job is assumed to be a callable, '
+                                f'not: {args[0]}')
+            job_func = args[0]
+            args = args[1:]
+            obj_1 = cls_as_callable_class(*args, **kwargs)(job_func)
+            return cast(IsJobTemplate, obj_1)
+        else:
+            obj_2 = cls(*args, **kwargs)
+            return cast(IsJobTemplate, obj_2)
+
+    @classmethod
+    def _create_job(cls, *args: object, **kwargs: object) -> IsJob:
+        if cls.__new__ is object.__new__:
+            obj = cls.__new__(cls)
+        else:
+            obj = cls.__new__(cls, *args, **kwargs)
+
+        # TODO: refactor using state machine
+
+        obj._from_apply = True
+        obj.__init__(*args, **kwargs)
+        obj._from_apply = False
+
+        return cast(IsJob, obj)
+
+    def _apply(self) -> IsJob:
+        job_cls = self._get_job_subcls_for_apply()
+        job = job_cls.create_job(*self._get_init_args(), **self._get_init_kwargs())
+
+        if self.engine:
+            job._apply_engine_decorator(self.engine)
+
+        return job
+
+    def _refine(self, *args: Any, update: bool = True, **kwargs: object) -> IsJobTemplate:
+        self_as_job_template = cast(IsJobTemplate, self)
+
+        refine_kwargs = kwargs.copy()
+
+        if update:
+            for key, cur_val in self._get_init_kwargs().items():
+                if key in refine_kwargs:
+                    refine_val = refine_kwargs[key]
+                    cur_val_dictable = as_dictable(cur_val)
+                    refine_val_dictable = as_dictable(refine_val)
+                    if cur_val_dictable is not None and refine_val_dictable is not None:
+                        new_val: Union[object,
+                                       Dict] = create_merged_dict(cur_val_dictable,
+                                                                  refine_val_dictable)
+                    else:
+                        new_val = refine_kwargs[key]
+                else:
+                    new_val = cur_val
+                refine_kwargs[key] = new_val
+
+        init_args = self._get_init_args()
+        refine_args = [init_args[0]] if len(init_args) >= 1 else []
+        refine_args += args if args else init_args[1:]
+
+        return self_as_job_template.create_job_template(*refine_args, **refine_kwargs)
+
+    def _revise(self) -> IsJobTemplate:
+        job_template_cls = self._get_job_template_subcls_for_revise()
+        job_template = job_template_cls.create_job_template(*self._get_init_args(),
+                                                            **self._get_init_kwargs())
+        return job_template
+
+    def _get_init_args(self) -> Tuple[object, ...]:
+        return ()
+
+    def _get_init_kwargs(self) -> Dict[str, object]:
+        kwarg_keys = list(self._mixin_init_kwarg_params_including_bases.keys())
+        for key in kwarg_keys:
+            attribute = getattr(self.__class__, key)
+
+            if not isinstance(attribute, property):
+                raise TypeError(f'{self.__class__.__name__} attribute "{key}" is not a property')
+
+            if attribute.fset is not None:
+                raise TypeError(f'{self.__class__.__name__} attribute "{key}" is not a property')
+
+            value = getattr(self, key)
+            if not isinstance(value, Hashable) and not isinstance(value, MappingProxyType):
+                raise TypeError(f'Value of {self.__class__.__name__} attribute "{key}" is mutable')
+
+        return {key: getattr(self, key) for key in kwarg_keys}
+
+    def __eq__(self, other: object) -> bool:
+        if not isinstance(other, JobBase):
+            return NotImplemented
+        return self._get_init_args() == other._get_init_args() \
+            and self._get_init_kwargs() == other._get_init_kwargs()
+
+    @classmethod
+    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:
+        return IsJobTemplate
+
+    @classmethod
+    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:
+        return IsJob
+
+    def _call_job_template(self, *args: object, **kwargs: object) -> object:
+        self_as_job_template = cast(IsJobTemplate, self)
+
+        if self.in_flow_context:
+            return self_as_job_template.run(*args, **kwargs)
+
+        raise TypeError(f"'{self.__class__.__name__}' object is not callable")
+
+    def _call_job(self, *args: object, **kwargs: object) -> object:
+        pass
+
+    def _check_engine(self, engine_protocol: Type):
+        if self.engine is None or not isinstance(self.engine, engine_protocol):
+            raise RuntimeError(f'Engine "{self.engine}" does not support '
+                               f'job runner protocol: {engine_protocol.__name__}')
+
+
+ + + +
+ + + + + + + +
+ + + +

+config: Optional[IsJobConfig] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+engine: Optional[IsEngine] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+in_flow_context: bool + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__eq__(other) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
148
+149
+150
+151
+152
def __eq__(self, other: object) -> bool:
+    if not isinstance(other, JobBase):
+        return NotImplemented
+    return self._get_init_args() == other._get_init_args() \
+        and self._get_init_kwargs() == other._get_init_kwargs()
+
+
+
+ +
+ +
+ + + +

+__init__(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
def __init__(self, *args: object, **kwargs: object):
+    # super().__init__()
+
+    # TODO: refactor using state machine
+
+    if not isinstance(self, JobTemplateMixin) and not isinstance(self, JobMixin):
+        raise JobStateException('JobBase and subclasses not inheriting from JobTemplateMixin '
+                                'or JobMixin are not directly instantiatable')
+
+    from_apply = hasattr(self, '_from_apply') and self._from_apply is True
+    if isinstance(self, JobMixin) and not from_apply:
+        raise JobStateException(
+            'JobMixin should only be instantiated using the "apply()" method of '
+            'an instance of JobTemplateMixin (or one of its subclasses)')
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ JobMixin + + +

+ + +
+

+ Bases: DynamicMixinAcceptor

+ + + +
+ Source code in src/omnipy/compute/job.py +
209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
class JobMixin(DynamicMixinAcceptor):
+    def __init__(self, *args, **kwargs):
+        if JobBase not in self.__class__.__mro__:
+            raise TypeError('JobMixin is not meant to be instantiated outside the context '
+                            'of a JobBase subclass.')
+
+    @abstractmethod
+    def _apply_engine_decorator(self, engine: IsEngine) -> None:
+        ...
+
+    @property
+    def time_of_cur_toplevel_flow_run(self) -> Optional[datetime]:
+        self_as_job_base = cast(IsJobBase, self)
+        return self_as_job_base._job_creator.time_of_cur_toplevel_nested_context_run
+
+    @classmethod
+    def create_job(cls, *args: object, **kwargs: object) -> IsJob:
+        cls_as_job_base = cast(IsJobBase, cls)
+        return cls_as_job_base._create_job(*args, **kwargs)
+
+    def revise(self) -> IsJobTemplate:
+        self_as_job_base = cast(IsJobBase, self)
+        job_template = self_as_job_base._revise()
+        update_wrapper(job_template, self, updated=[])
+        return job_template
+
+    def __call__(self, *args: object, **kwargs: object) -> object:
+        self_as_job_base = cast(IsJobBase, self)
+
+        try:
+            return self_as_job_base._call_job(*args, **kwargs)
+        except Exception as e:
+            self_as_job_base.log(str(e), level=logging.ERROR)
+            raise
+
+
+ + + +
+ + + + + + + +
+ + + +

+time_of_cur_toplevel_flow_run: Optional[datetime] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__call__(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
235
+236
+237
+238
+239
+240
+241
+242
def __call__(self, *args: object, **kwargs: object) -> object:
+    self_as_job_base = cast(IsJobBase, self)
+
+    try:
+        return self_as_job_base._call_job(*args, **kwargs)
+    except Exception as e:
+        self_as_job_base.log(str(e), level=logging.ERROR)
+        raise
+
+
+
+ +
+ +
+ + + +

+__init__(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
210
+211
+212
+213
def __init__(self, *args, **kwargs):
+    if JobBase not in self.__class__.__mro__:
+        raise TypeError('JobMixin is not meant to be instantiated outside the context '
+                        'of a JobBase subclass.')
+
+
+
+ +
+ +
+ + + +

+create_job(*args, **kwargs) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
224
+225
+226
+227
@classmethod
+def create_job(cls, *args: object, **kwargs: object) -> IsJob:
+    cls_as_job_base = cast(IsJobBase, cls)
+    return cls_as_job_base._create_job(*args, **kwargs)
+
+
+
+ +
+ +
+ + + +

+revise() + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
229
+230
+231
+232
+233
def revise(self) -> IsJobTemplate:
+    self_as_job_base = cast(IsJobBase, self)
+    job_template = self_as_job_base._revise()
+    update_wrapper(job_template, self, updated=[])
+    return job_template
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ JobTemplateMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/job.py +
179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
class JobTemplateMixin:
+    def __init__(self, *args, **kwargs):
+        if JobBase not in self.__class__.__mro__:
+            raise TypeError('JobTemplateMixin is not meant to be instantiated outside the context '
+                            'of a JobBase subclass.')
+
+    @classmethod
+    def create_job_template(cls: Type[IsJobBase], *args: object, **kwargs: object) -> IsJobTemplate:
+        return cls._create_job_template(*args, **kwargs)
+
+    def run(self, *args: object, **kwargs: object) -> object:
+        # TODO: Using JobTemplateMixin.run() inside flows should give error message
+
+        return self.apply()(*args, **kwargs)
+
+    def apply(self) -> IsJob:
+        self_as_job_base = cast(IsJobBase, self)
+        job = self_as_job_base._apply()
+        update_wrapper(job, self, updated=[])
+        return job
+
+    def refine(self, *args: Any, update: bool = True, **kwargs: object) -> IsJobTemplate:
+        self_as_job_base = cast(IsJobBase, self)
+        return self_as_job_base._refine(*args, update=update, **kwargs)
+
+    def __call__(self, *args: object, **kwargs: object) -> object:
+        self_as_job_base = cast(IsJobBase, self)
+        return self_as_job_base._call_job_template(*args, **kwargs)
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__call__(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
204
+205
+206
def __call__(self, *args: object, **kwargs: object) -> object:
+    self_as_job_base = cast(IsJobBase, self)
+    return self_as_job_base._call_job_template(*args, **kwargs)
+
+
+
+ +
+ +
+ + + +

+__init__(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
180
+181
+182
+183
def __init__(self, *args, **kwargs):
+    if JobBase not in self.__class__.__mro__:
+        raise TypeError('JobTemplateMixin is not meant to be instantiated outside the context '
+                        'of a JobBase subclass.')
+
+
+
+ +
+ +
+ + + +

+apply() + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
194
+195
+196
+197
+198
def apply(self) -> IsJob:
+    self_as_job_base = cast(IsJobBase, self)
+    job = self_as_job_base._apply()
+    update_wrapper(job, self, updated=[])
+    return job
+
+
+
+ +
+ +
+ + + +

+create_job_template(*args, **kwargs) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
185
+186
+187
@classmethod
+def create_job_template(cls: Type[IsJobBase], *args: object, **kwargs: object) -> IsJobTemplate:
+    return cls._create_job_template(*args, **kwargs)
+
+
+
+ +
+ +
+ + + +

+refine(*args, update=True, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
200
+201
+202
def refine(self, *args: Any, update: bool = True, **kwargs: object) -> IsJobTemplate:
+    self_as_job_base = cast(IsJobBase, self)
+    return self_as_job_base._refine(*args, update=update, **kwargs)
+
+
+
+ +
+ +
+ + + +

+run(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job.py +
189
+190
+191
+192
def run(self, *args: object, **kwargs: object) -> object:
+    # TODO: Using JobTemplateMixin.run() inside flows should give error message
+
+    return self.apply()(*args, **kwargs)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/job_creator/index.html b/docs/mkdocs_site/reference/omnipy/compute/job_creator/index.html new file mode 100644 index 00000000..ae18ded7 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/job_creator/index.html @@ -0,0 +1,2954 @@ + + + + + + + + + + + + + + + + + + + + + + job_creator - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

job_creator

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ JobBaseMeta + + +

+ + +
+

+ Bases: ABCMeta

+ + + + + +
+ Source code in src/omnipy/compute/job_creator.py +
54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
class JobBaseMeta(ABCMeta):
+    """"""
+    _job_creator_obj = JobCreator()
+
+    @property
+    def job_creator(self) -> IsJobCreator:
+        return self._job_creator_obj
+
+    @property
+    def nested_context_level(self) -> int:
+        return self.job_creator.nested_context_level
+
+
+ + + +
+ + + + + + + +
+ + + +

+job_creator: IsJobCreator + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+nested_context_level: int + + + property + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ JobCreator + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/job_creator.py +
12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
class JobCreator:
+    def __init__(self) -> None:
+        self._engine: Optional[IsEngine] = None
+        self._config: Optional[IsJobConfig] = None
+        self._nested_context_level: int = 0
+        self._time_of_cur_toplevel_nested_context_run: Optional[datetime] = None
+
+    def set_engine(self, engine: IsEngine) -> None:
+        self._engine = engine
+
+    def set_config(self, config: IsJobConfig) -> None:
+        self._config = config
+
+    def __enter__(self):
+        if self._nested_context_level == 0:
+            self._time_of_cur_toplevel_nested_context_run = datetime.now()
+
+        self._nested_context_level += 1
+
+    def __exit__(self, exc_type, exc_value, traceback):
+        self._nested_context_level -= 1
+
+        if self._nested_context_level == 0:
+            self._time_of_cur_toplevel_nested_context_run = None
+
+    @property
+    def engine(self) -> Optional[IsEngine]:
+        return self._engine
+
+    @property
+    def config(self) -> Optional[IsJobConfig]:
+        return self._config
+
+    @property
+    def nested_context_level(self) -> int:
+        return self._nested_context_level
+
+    @property
+    def time_of_cur_toplevel_nested_context_run(self) -> Optional[datetime]:
+        return self._time_of_cur_toplevel_nested_context_run
+
+
+ + + +
+ + + + + + + +
+ + + +

+config: Optional[IsJobConfig] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+engine: Optional[IsEngine] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+nested_context_level: int + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+time_of_cur_toplevel_nested_context_run: Optional[datetime] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__enter__() + +

+ + +
+ +
+ Source code in src/omnipy/compute/job_creator.py +
25
+26
+27
+28
+29
def __enter__(self):
+    if self._nested_context_level == 0:
+        self._time_of_cur_toplevel_nested_context_run = datetime.now()
+
+    self._nested_context_level += 1
+
+
+
+ +
+ +
+ + + +

+__exit__(exc_type, exc_value, traceback) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job_creator.py +
31
+32
+33
+34
+35
def __exit__(self, exc_type, exc_value, traceback):
+    self._nested_context_level -= 1
+
+    if self._nested_context_level == 0:
+        self._time_of_cur_toplevel_nested_context_run = None
+
+
+
+ +
+ +
+ + + +

+__init__() + +

+ + +
+ +
+ Source code in src/omnipy/compute/job_creator.py +
13
+14
+15
+16
+17
def __init__(self) -> None:
+    self._engine: Optional[IsEngine] = None
+    self._config: Optional[IsJobConfig] = None
+    self._nested_context_level: int = 0
+    self._time_of_cur_toplevel_nested_context_run: Optional[datetime] = None
+
+
+
+ +
+ +
+ + + +

+set_config(config) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job_creator.py +
22
+23
def set_config(self, config: IsJobConfig) -> None:
+    self._config = config
+
+
+
+ +
+ +
+ + + +

+set_engine(engine) + +

+ + +
+ +
+ Source code in src/omnipy/compute/job_creator.py +
19
+20
def set_engine(self, engine: IsEngine) -> None:
+    self._engine = engine
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/flow_context/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/flow_context/index.html new file mode 100644 index 00000000..e52306cd --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/flow_context/index.html @@ -0,0 +1,2533 @@ + + + + + + + + + + + + + + + + + + + + + + flow_context - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

flow_context

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ FlowContextJobMixin + + +

+ + +
+ + + + + +
+ Source code in src/omnipy/compute/mixins/flow_context.py +
 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
class FlowContextJobMixin:
+    """"""
+    def __init__(self) -> None:
+        self._time_of_last_run = None
+
+    @property
+    def flow_context(self) -> IsNestedContext:
+        class FlowContext:
+            @classmethod
+            def __enter__(cls):
+                self.__class__.job_creator.__enter__()
+                self._time_of_last_run = self.time_of_cur_toplevel_flow_run
+
+            @classmethod
+            def __exit__(cls, exc_type, exc_val, exc_tb):
+                self.__class__.job_creator.__exit__(exc_type, exc_val, exc_tb)
+
+        return FlowContext()
+
+    @property
+    def time_of_last_run(self) -> Optional[datetime]:
+        return self._time_of_last_run
+
+
+ + + +
+ + + + + + + +
+ + + +

+flow_context: IsNestedContext + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+time_of_last_run: Optional[datetime] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__() + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/flow_context.py +
 9
+10
def __init__(self) -> None:
+    self._time_of_last_run = None
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/func_signature/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/func_signature/index.html new file mode 100644 index 00000000..a043bce4 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/func_signature/index.html @@ -0,0 +1,2629 @@ + + + + + + + + + + + + + + + + + + + + + + func_signature - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

func_signature

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ SignatureFuncJobBaseMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/mixins/func_signature.py +
 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
class SignatureFuncJobBaseMixin:
+    def __init__(self):
+        self._func_signature = inspect.signature(self._job_func)
+        self.__signature__ = self._func_signature
+
+    @property
+    def param_signatures(self) -> MappingProxyType:
+        return self._func_signature.parameters
+
+    @property
+    def return_type(self) -> Type[object]:
+        return self._func_signature.return_annotation
+
+    def _check_param_keys_in_func_signature(self,
+                                            param_keys: Iterable[str],
+                                            modifier_kwarg_key: str) -> None:
+        if any(param.kind == inspect.Parameter.VAR_KEYWORD
+               for param in self.param_signatures.values()):
+            return
+
+        for param_key in param_keys:
+            if param_key not in self.param_signatures:
+                raise KeyError('Parameter "{}" was not found in the '.format(param_key)
+                               + 'signature of the job function. Only parameters in the '
+                               'signature of the job function are '
+                               f'allowed as keys in the "{modifier_kwarg_key}" modifier: '
+                               f"{', '.join(key for key in self.param_signatures.keys())}")
+
+    def _update_func_signature(self, new_signature: inspect.Signature):
+        # self._job_func.__signature__ = new_signature
+        self._func_signature = new_signature
+        self.__signature__ = new_signature
+
+    def get_call_args(self, *args: object, **kwargs: object) -> Dict[str, object]:
+        return self._func_signature.bind(*args, **kwargs).arguments
+
+
+ + + +
+ + + + + + + +
+ + + +

+__signature__ = self._func_signature + + + instance-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+param_signatures: MappingProxyType + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+return_type: Type[object] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__() + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/func_signature.py +
7
+8
+9
def __init__(self):
+    self._func_signature = inspect.signature(self._job_func)
+    self.__signature__ = self._func_signature
+
+
+
+ +
+ +
+ + + +

+get_call_args(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/func_signature.py +
39
+40
def get_call_args(self, *args: object, **kwargs: object) -> Dict[str, object]:
+    return self._func_signature.bind(*args, **kwargs).arguments
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/index.html new file mode 100644 index 00000000..dfc625a0 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/index.html @@ -0,0 +1,2282 @@ + + + + + + + + + + + + + + + + + + + + + + mixins - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

mixins

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/iterate/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/iterate/index.html new file mode 100644 index 00000000..c65ad537 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/iterate/index.html @@ -0,0 +1,2624 @@ + + + + + + + + + + + + + + + + + + + + + + iterate - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

iterate

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IterateFuncJobBaseMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/mixins/iterate.py +
 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
class IterateFuncJobBaseMixin:
+    def __init__(self, *, iterate_over_data_files: bool = False):
+        self_as_plain_func_arg_job_base = cast(IsPlainFuncArgJobBase, self)
+        self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)
+
+        self._iterate_over_data_files = iterate_over_data_files
+
+        if not isinstance(self.iterate_over_data_files, bool):
+            raise TypeError(
+                'Value of "iterate_over_data_files" parameter must be bool (True/False), '
+                f'not "{iterate_over_data_files}"')
+
+        if iterate_over_data_files:
+            job_func = self_as_plain_func_arg_job_base._job_func
+            if job_func.__name__ != '_omnipy_iterate_func':
+
+                def _iterate_over_data_files_decorator(call_func: Callable):
+                    def _omnipy_iterate_func(
+                        dataset: InputDatasetT,
+                        *args: object,
+                        **kwargs: object,
+                    ) -> ReturnDatasetT:
+                        inner_func: IsIterateInnerCallable = \
+                            cast(IsIterateInnerCallable, call_func)
+
+                        return_type = signature(job_func).return_annotation
+                        out_dataset_cls = _create_dataset_cls(return_type)
+                        out_dataset = out_dataset_cls()
+
+                        for title, data_file in dataset.items():
+                            out_dataset[title] = inner_func(data_file, *args, **kwargs)
+
+                        return out_dataset
+
+                    return _omnipy_iterate_func
+
+                _check_job_func_parameters(job_func)
+                self_as_plain_func_arg_job_base._accept_call_func_decorator(
+                    _iterate_over_data_files_decorator)
+
+                new_signature = _generate_new_signature(job_func)
+                self_as_signature_func_job_base_mixin._update_func_signature(new_signature)
+
+    @property
+    def iterate_over_data_files(self) -> bool:
+        return self._iterate_over_data_files
+
+
+ + + +
+ + + + + + + +
+ + + +

+iterate_over_data_files: bool + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(*, iterate_over_data_files=False) + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/iterate.py +
56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
def __init__(self, *, iterate_over_data_files: bool = False):
+    self_as_plain_func_arg_job_base = cast(IsPlainFuncArgJobBase, self)
+    self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)
+
+    self._iterate_over_data_files = iterate_over_data_files
+
+    if not isinstance(self.iterate_over_data_files, bool):
+        raise TypeError(
+            'Value of "iterate_over_data_files" parameter must be bool (True/False), '
+            f'not "{iterate_over_data_files}"')
+
+    if iterate_over_data_files:
+        job_func = self_as_plain_func_arg_job_base._job_func
+        if job_func.__name__ != '_omnipy_iterate_func':
+
+            def _iterate_over_data_files_decorator(call_func: Callable):
+                def _omnipy_iterate_func(
+                    dataset: InputDatasetT,
+                    *args: object,
+                    **kwargs: object,
+                ) -> ReturnDatasetT:
+                    inner_func: IsIterateInnerCallable = \
+                        cast(IsIterateInnerCallable, call_func)
+
+                    return_type = signature(job_func).return_annotation
+                    out_dataset_cls = _create_dataset_cls(return_type)
+                    out_dataset = out_dataset_cls()
+
+                    for title, data_file in dataset.items():
+                        out_dataset[title] = inner_func(data_file, *args, **kwargs)
+
+                    return out_dataset
+
+                return _omnipy_iterate_func
+
+            _check_job_func_parameters(job_func)
+            self_as_plain_func_arg_job_base._accept_call_func_decorator(
+                _iterate_over_data_files_decorator)
+
+            new_signature = _generate_new_signature(job_func)
+            self_as_signature_func_job_base_mixin._update_func_signature(new_signature)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/mixin_types/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/mixin_types/index.html new file mode 100644 index 00000000..14e18bc8 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/mixin_types/index.html @@ -0,0 +1,2721 @@ + + + + + + + + + + + + + + + + + + + + + + mixin_types - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

mixin_types

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+InputDatasetT = Union[Dataset[Model[InputT]], Dataset[ModelInputT]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+InputT = TypeVar('InputT', bound=object) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+InputTypeT = Union[InputT, ModelInputT] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ModelInputT = TypeVar('ModelInputT', bound=Model) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ModelReturnT = TypeVar('ModelReturnT', bound=Model) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ReturnDatasetT = Union[Dataset[Model[ReturnT]], Dataset[ModelReturnT]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ReturnT = TypeVar('ReturnT', bound=object) + + + module-attribute + + +

+ + +
+
+ +
+ + +
+ + + +

+ IsIterateInnerCallable + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/compute/mixins/mixin_types.py +
15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
class IsIterateInnerCallable(Protocol):
+    """"""
+    def __call__(
+        self,
+        data_file: Union[InputT, ModelInputT],
+        *args: object,
+        **kwargs: object,
+    ) -> Union[ReturnT, ModelReturnT]:
+        ...
+
+    __name__: str
+
+
+ + + +
+ + + + + + + +
+ + + +

+__name__: str + + + instance-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+__call__(data_file, *args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/mixin_types.py +
17
+18
+19
+20
+21
+22
+23
def __call__(
+    self,
+    data_file: Union[InputT, ModelInputT],
+    *args: object,
+    **kwargs: object,
+) -> Union[ReturnT, ModelReturnT]:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/name/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/name/index.html new file mode 100644 index 00000000..a9bd6dcf --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/name/index.html @@ -0,0 +1,2695 @@ + + + + + + + + + + + + + + + + + + + + + + name - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

name

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ NameJobBaseMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/mixins/name.py +
10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
class NameJobBaseMixin:
+    def __init__(self, *, name: Optional[str] = None):
+        self._name: Optional[str] = name
+
+        if self._name is not None:
+            self._check_not_empty_string('name', self._name)
+        else:
+            if hasattr(self, '_job_func'):
+                self._name = self._job_func.__name__
+
+        # TODO: When job state machine is implemented, check using that to see if in job state
+        self._unique_name = self._generate_unique_name() if hasattr(self, 'create_job') else None
+
+    @staticmethod
+    def _check_not_empty_string(param_name: str, param: str) -> None:
+        if len(param) == 0:
+            raise ValueError('Empty strings not allowed for parameter "{}"'.format(param_name))
+
+    @property
+    def name(self) -> Optional[str]:
+        return self._name
+
+    @property
+    def unique_name(self) -> Optional[str]:
+        return self._unique_name
+
+    def _generate_unique_name(self) -> Optional[str]:
+        if self._name is None:
+            return None
+
+        class_name = self.__class__.__name__
+        if class_name.endswith(DynamicMixinAcceptor.WITH_MIXINS_CLS_PREFIX):
+            class_name = class_name[:-len(DynamicMixinAcceptor.WITH_MIXINS_CLS_PREFIX)]
+
+        class_name_snake_case = underscore(class_name)
+        return slugify(f'{class_name_snake_case}-{self._name}-{generate_slug(2)}')
+
+    def _regenerate_unique_name(self) -> None:
+        self._unique_name = self._generate_unique_name()
+
+
+ + + +
+ + + + + + + +
+ + + +

+name: Optional[str] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+unique_name: Optional[str] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(*, name=None) + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/name.py +
11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
def __init__(self, *, name: Optional[str] = None):
+    self._name: Optional[str] = name
+
+    if self._name is not None:
+        self._check_not_empty_string('name', self._name)
+    else:
+        if hasattr(self, '_job_func'):
+            self._name = self._job_func.__name__
+
+    # TODO: When job state machine is implemented, check using that to see if in job state
+    self._unique_name = self._generate_unique_name() if hasattr(self, 'create_job') else None
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ NameJobMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/mixins/name.py +
51
+52
+53
+54
class NameJobMixin:
+    def regenerate_unique_name(self) -> None:
+        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)
+        self_as_name_job_base_mixin._regenerate_unique_name()
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+regenerate_unique_name() + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/name.py +
52
+53
+54
def regenerate_unique_name(self) -> None:
+    self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)
+    self_as_name_job_base_mixin._regenerate_unique_name()
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/params/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/params/index.html new file mode 100644 index 00000000..5eca0cd6 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/params/index.html @@ -0,0 +1,2629 @@ + + + + + + + + + + + + + + + + + + + + + + params - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

params

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ ParamsFuncJobBaseMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/mixins/params.py +
11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
class ParamsFuncJobBaseMixin:
+    def __init__(
+        self,
+        *,
+        fixed_params: Optional[Mapping[str, object]] = None,
+        param_key_map: Optional[Mapping[str, str]] = None,
+    ):
+        self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)
+
+        self._fixed_params = dict(fixed_params) if fixed_params is not None else {}
+        self._param_key_mapper = ParamKeyMapper(param_key_map if param_key_map is not None else {})
+
+        self_as_signature_func_job_base_mixin._check_param_keys_in_func_signature(
+            self.fixed_params.keys(), 'fixed_params')
+        self_as_signature_func_job_base_mixin._check_param_keys_in_func_signature(
+            self.param_key_map.keys(), 'param_key_map')
+
+    @property
+    def fixed_params(self) -> MappingProxyType[str, object]:
+        return MappingProxyType(self._fixed_params)
+
+    @property
+    def param_key_map(self) -> MappingProxyType[str, str]:
+        return MappingProxyType(self._param_key_mapper.key_map)
+
+    def _call_job(self, *args: object, **kwargs: object) -> object:
+        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)
+        self_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)
+
+        mapped_fixed_params = self._param_key_mapper.delete_matching_keys(
+            self._fixed_params, inverse=True)
+        mapped_kwargs = self._param_key_mapper.map_matching_keys_delete_inverse_matches_keep_rest(
+            kwargs, inverse=True)
+        try:
+            if len(mapped_kwargs) < len(kwargs):
+                raise TypeError('Keyword arguments {} matches parameter key map inversely.'.format(
+                    tuple(set(kwargs.keys()) - set(mapped_kwargs.keys()))))
+
+            super_as_job_base = cast(IsJobBase, super())
+            result = super_as_job_base._call_job(*args, **mapped_fixed_params, **mapped_kwargs)
+
+        except TypeError as e:
+            if str(e).startswith('Incorrect job function arguments'):
+                raise TypeError(
+                    f'Incorrect job function arguments for job "{self_as_name_job_base_mixin.name}"!\n'
+                    f'Job class name: {self.__class__.__name__}\n'
+                    f'Current parameter key map contents: {self.param_key_map}\n'
+                    f'Positional arguments: {repr_max_len(args)}\n'
+                    f'Keyword arguments: {repr_max_len(kwargs)}\n'
+                    f'Mapped fixed parameters: {repr_max_len(mapped_fixed_params)}\n'
+                    f'Mapped keyword arguments: {repr_max_len(mapped_kwargs)}\n'
+                    f'Call function signature parameters: '
+                    f'{[(str(p), p.kind) for p in self_signature_func_job_base_mixin.param_signatures.values()]}'
+                ) from e
+            else:
+                raise
+
+        return result
+
+
+ + + +
+ + + + + + + +
+ + + +

+fixed_params: MappingProxyType[str, object] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+param_key_map: MappingProxyType[str, str] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(*, fixed_params=None, param_key_map=None) + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/params.py +
12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
def __init__(
+    self,
+    *,
+    fixed_params: Optional[Mapping[str, object]] = None,
+    param_key_map: Optional[Mapping[str, str]] = None,
+):
+    self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)
+
+    self._fixed_params = dict(fixed_params) if fixed_params is not None else {}
+    self._param_key_mapper = ParamKeyMapper(param_key_map if param_key_map is not None else {})
+
+    self_as_signature_func_job_base_mixin._check_param_keys_in_func_signature(
+        self.fixed_params.keys(), 'fixed_params')
+    self_as_signature_func_job_base_mixin._check_param_keys_in_func_signature(
+        self.param_key_map.keys(), 'param_key_map')
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/result_key/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/result_key/index.html new file mode 100644 index 00000000..2f32a966 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/result_key/index.html @@ -0,0 +1,2506 @@ + + + + + + + + + + + + + + + + + + + + + + result_key - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

result_key

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ ResultKeyFuncJobBaseMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/mixins/result_key.py +
 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
class ResultKeyFuncJobBaseMixin:
+    def __init__(self, *, result_key: Optional[str] = None):
+        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)
+
+        self._result_key = result_key
+
+        if self.result_key is not None:
+            self_as_name_job_base_mixin._check_not_empty_string('result_key', self.result_key)
+
+    @property
+    def result_key(self) -> Optional[str]:
+        return self._result_key
+
+    def _call_job(self, *args: object, **kwargs: object) -> object:
+        super_as_job_base = cast(IsJobBase, super())
+        result = super_as_job_base._call_job(*args, **kwargs)
+
+        if self._result_key:
+            return {self._result_key: result}
+        else:
+            return result
+
+
+ + + +
+ + + + + + + +
+ + + +

+result_key: Optional[str] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(*, result_key=None) + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/result_key.py +
 8
+ 9
+10
+11
+12
+13
+14
def __init__(self, *, result_key: Optional[str] = None):
+    self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)
+
+    self._result_key = result_key
+
+    if self.result_key is not None:
+        self_as_name_job_base_mixin._check_not_empty_string('result_key', self.result_key)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/mixins/serialize/index.html b/docs/mkdocs_site/reference/omnipy/compute/mixins/serialize/index.html new file mode 100644 index 00000000..8f677df7 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/mixins/serialize/index.html @@ -0,0 +1,3081 @@ + + + + + + + + + + + + + + + + + + + + + + serialize - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

serialize

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+PersistOpts = PersistOutputsOptions + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+RestoreOpts = RestoreOutputsOptions + + + module-attribute + + +

+ + +
+
+ +
+ + +
+ + + +

+ SerializerFuncJobBaseMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/mixins/serialize.py +
 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
class SerializerFuncJobBaseMixin:
+    def __init__(self,
+                 *,
+                 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:
+            self._persist_outputs = PersistOpts(persist_outputs)
+
+        if restore_outputs is None:
+            self._restore_outputs = RestoreOpts.FOLLOW_CONFIG if self._has_job_config else None
+        else:
+            self._restore_outputs = RestoreOpts(restore_outputs)
+
+        self._serializer_registry = self._create_serializer_registry()
+
+    def _create_serializer_registry(self):
+        # TODO: store in runtime, to remove dependencies
+        registry = SerializerRegistry()
+
+        registry.register(PandasDatasetToTarFileSerializer)
+        registry.register(RawDatasetToTarFileSerializer)
+        registry.register(JsonDatasetToTarFileSerializer)
+
+        return registry
+
+    @property
+    def _has_job_config(self) -> bool:
+        self_as_job_base = cast(IsJobBase, self)
+        return self_as_job_base.config is not None
+
+    @property
+    def _job_config(self) -> IsJobConfig:
+        self_as_job_base = cast(IsJobBase, self)
+        if self_as_job_base.config is None:
+            return JobConfig()
+        else:
+            return self_as_job_base.config
+
+    def _log(self, msg: str) -> None:
+        self_as_job_base = cast(IsJobBase, self)
+        self_as_job_base.log(msg)
+
+    @property
+    def _return_type(self) -> Type[object]:
+        self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)
+        return self_as_signature_func_job_base_mixin.return_type
+
+    @property
+    def persist_outputs(self) -> Optional[PersistOutputsOptions]:
+        return self._persist_outputs
+
+    @property
+    def restore_outputs(self) -> Optional[RestoreOutputsOptions]:
+        return self._restore_outputs
+
+    @property
+    def will_persist_outputs(self) -> PersistOutputsOptions:
+        if not self._has_job_config or self._persist_outputs is not PersistOpts.FOLLOW_CONFIG:
+            return self._persist_outputs if self._persist_outputs is not None \
+                else PersistOpts.DISABLED
+        else:
+            # TODO: Refactor using Flow and Task Mixins
+            from omnipy.compute.flow import FlowBase
+            from omnipy.compute.task import TaskBase
+
+            config_persist_opt = self._job_config.persist_outputs
+
+            if config_persist_opt == ConfigPersistOpts.ENABLE_FLOW_OUTPUTS:
+                return PersistOpts.ENABLED if isinstance(self, FlowBase) else PersistOpts.DISABLED
+            elif config_persist_opt == ConfigPersistOpts.ENABLE_FLOW_AND_TASK_OUTPUTS:
+                return PersistOpts.ENABLED \
+                    if any(isinstance(self, cls) for cls in (FlowBase, TaskBase)) \
+                    else PersistOpts.DISABLED
+            else:
+                assert config_persist_opt == ConfigPersistOpts.DISABLED
+                return PersistOpts.DISABLED
+
+    @property
+    def will_restore_outputs(self) -> RestoreOutputsOptions:
+        if not self._has_job_config or self._restore_outputs is not RestoreOpts.FOLLOW_CONFIG:
+            return self._restore_outputs if self._restore_outputs is not None \
+                else RestoreOpts.DISABLED
+        else:
+            config_restore_opt = self._job_config.restore_outputs
+
+            if config_restore_opt == ConfigRestoreOpts.AUTO_ENABLE_IGNORE_PARAMS:
+                return RestoreOpts.AUTO_ENABLE_IGNORE_PARAMS
+            assert config_restore_opt == ConfigRestoreOpts.DISABLED
+            return RestoreOpts.DISABLED
+
+    def _call_job(self, *args: object, **kwargs: object) -> object:
+        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)
+
+        if self.will_restore_outputs in [
+                RestoreOpts.AUTO_ENABLE_IGNORE_PARAMS, RestoreOpts.FORCE_ENABLE_IGNORE_PARAMS
+        ]:
+            try:
+                return self._deserialize_and_restore_outputs()
+            except Exception:
+                if self.will_restore_outputs is RestoreOpts.FORCE_ENABLE_IGNORE_PARAMS:
+                    raise
+
+        super_as_job_base = cast(IsJobBase, super())
+        results = super_as_job_base._call_job(*args, **kwargs)
+
+        if self.will_persist_outputs is PersistOpts.ENABLED:
+            if isinstance(results, Dataset):
+                self._serialize_and_persist_outputs(results)
+            else:
+                self._log(
+                    f'Results of {self_as_name_job_base_mixin.unique_name} is not a Dataset and '
+                    f'cannot be automatically serialized and persisted!')
+
+        return results
+
+    def _serialize_and_persist_outputs(self, results: Dataset):
+        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)
+
+        datetime_str = self._generate_datetime_str()
+        output_path = Path(self._job_config.persist_data_dir_path).joinpath(datetime_str)
+
+        if not os.path.exists(output_path):
+            os.makedirs(output_path)
+
+        num_cur_files = len(os.listdir(output_path))
+        job_name = self._job_name()
+
+        file_path = output_path.joinpath(f'{num_cur_files:02}_{job_name}.tar.gz')
+
+        parsed_dataset, serializer = \
+            self._serializer_registry.auto_detect_tar_file_serializer(results)
+
+        if serializer is None:
+            self._log('Unable to find a serializer for results of job '
+                      f'"{self_as_name_job_base_mixin.name}", with data type "{type(results)}". '
+                      f'Will abort persisting results...')
+        else:
+            self._log(f'Writing dataset as a gzipped tarpack to "{os.path.abspath(file_path)}"')
+
+            with open(file_path, 'wb') as tarfile:
+                tarfile.write(serializer.serialize(parsed_dataset))
+
+    def _job_name(self):
+        return '_'.join(self.unique_name.split('-')[:-2])
+
+    def _generate_datetime_str(self):
+        if self.time_of_cur_toplevel_flow_run:
+            run_time = self.time_of_cur_toplevel_flow_run
+        else:
+            if hasattr(self, 'time_of_last_run') and self.time_of_last_run:
+                run_time = self.time_of_last_run
+            else:
+                run_time = datetime.now()
+        datetime_str = run_time.strftime('%Y_%m_%d-%H_%M_%S')
+        return datetime_str
+
+    @staticmethod
+    def _all_job_output_file_paths_in_reverse_order_for_last_run(
+            persist_data_dir_path: Path, job_name: str) -> Generator[Path, None, None]:
+        sorted_date_dirs = list(sorted(os.listdir(persist_data_dir_path)))
+        if len(sorted_date_dirs) > 0:
+            last_dir = sorted_date_dirs[-1]
+            last_dir_path = persist_data_dir_path.joinpath(last_dir)
+            for job_output_name in reversed(sorted(os.listdir(last_dir_path))):
+                name_part_of_filename = job_output_name[3:-7]
+                if name_part_of_filename == job_name:
+                    yield last_dir_path.joinpath(job_output_name)
+        else:
+            raise StopIteration
+
+    # TODO: Further refactor _deserialize_and_restore_outputs
+    def _deserialize_and_restore_outputs(self) -> Dataset:
+        persist_data_dir_path = Path(self._job_config.persist_data_dir_path)
+        if os.path.exists(persist_data_dir_path):
+            for tar_file_path in self._all_job_output_file_paths_in_reverse_order_for_last_run(
+                    persist_data_dir_path, self._job_name()):
+                with tarfile.open(tar_file_path, 'r:gz') as tarfile_obj:
+                    file_suffixes = set(fn.split('.')[-1] for fn in tarfile_obj.getnames())
+                if len(file_suffixes) != 1:
+                    self._log(f'Tar archive contains files with different or '
+                              f'no file suffixes: {file_suffixes}. Serializer '
+                              f'cannot be uniquely determined. Aborting '
+                              f'restore.')
+                else:
+                    file_suffix = file_suffixes.pop()
+                    serializers = self._serializer_registry.\
+                        detect_tar_file_serializers_from_file_suffix(file_suffix)
+                    if len(serializers) == 0:
+                        self._log(f'No serializer for file suffix "{file_suffix}" can be'
+                                  f'determined. Aborting restore.')
+                    else:
+                        self._log(f'Reading dataset from a gzipped tarpack at'
+                                  f' "{os.path.abspath(tar_file_path)}"')
+
+                        serializer = serializers[0]
+                        with open(tar_file_path, 'rb') as tarfile_binary:
+                            dataset = serializer.deserialize(tarfile_binary.read())
+                        return_dataset_cls = cast(Type[Dataset], self._return_type)
+                        if return_dataset_cls().get_model_class() is dataset.get_model_class():
+                            return dataset
+                        else:
+                            try:
+                                new_dataset = return_dataset_cls()
+                                if new_dataset.get_model_class() is Model[str]:
+                                    new_dataset.from_data(dataset.to_json())
+                                else:
+                                    new_dataset.from_json(dataset.to_data())
+                                return new_dataset
+                            except Exception:
+                                return dataset
+
+        raise RuntimeError('No persisted output')
+
+
+ + + +
+ + + + + + + +
+ + + +

+persist_outputs: Optional[PersistOutputsOptions] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+restore_outputs: Optional[RestoreOutputsOptions] + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+will_persist_outputs: PersistOutputsOptions + + + property + + +

+ + +
+
+ +
+ +
+ + + +

+will_restore_outputs: RestoreOutputsOptions + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(*, persist_outputs=None, restore_outputs=None) + +

+ + +
+ +
+ Source code in src/omnipy/compute/mixins/serialize.py +
27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
def __init__(self,
+             *,
+             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:
+        self._persist_outputs = PersistOpts(persist_outputs)
+
+    if restore_outputs is None:
+        self._restore_outputs = RestoreOpts.FOLLOW_CONFIG if self._has_job_config else None
+    else:
+        self._restore_outputs = RestoreOpts(restore_outputs)
+
+    self._serializer_registry = self._create_serializer_registry()
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/task/index.html b/docs/mkdocs_site/reference/omnipy/compute/task/index.html new file mode 100644 index 00000000..2626986a --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/task/index.html @@ -0,0 +1,2543 @@ + + + + + + + + + + + + + + + + + + + + + + task - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

task

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ Task + + +

+ + +
+

+ Bases: JobMixin, TaskBase, FuncArgJobBase

+ + + +
+ Source code in src/omnipy/compute/task.py +
34
+35
+36
+37
+38
+39
+40
+41
+42
+43
class Task(JobMixin, TaskBase, FuncArgJobBase):
+    def _apply_engine_decorator(self, engine: IsEngine) -> None:
+        if self.engine:
+            engine = cast(IsTaskRunnerEngine, self.engine)
+            self_with_mixins = cast(IsTask, self)
+            engine.apply_task_decorator(self_with_mixins, self._accept_call_func_decorator)
+
+    @classmethod
+    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:
+        return cast(Type[IsTaskTemplate], TaskTemplate)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ TaskBase + + +

+ + +
+ + + +
+ Source code in src/omnipy/compute/task.py +
21
+22
+23
class TaskBase:
+    # TODO: Can this and FlowBase be replaced with IsTask/IsFlow, or similar?
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ TaskTemplate + + +

+ + +
+

+ Bases: JobTemplateMixin, TaskBase, FuncArgJobBase

+ + + + + +
+ Source code in src/omnipy/compute/task.py +
26
+27
+28
+29
+30
+31
@task_template_callable_decorator_cls
+class TaskTemplate(JobTemplateMixin, TaskBase, FuncArgJobBase):
+    """"""
+    @classmethod
+    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:
+        return cast(Type[IsTask], Task)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + +
+ + + +

+task_template_callable_decorator_cls(cls) + +

+ + +
+ +
+ Source code in src/omnipy/compute/task.py +
16
+17
+18
def task_template_callable_decorator_cls(
+        cls: Type[TaskTemplate]) -> IsFuncArgJobTemplateCallable[IsTaskTemplate]:
+    return cast(IsFuncArgJobTemplateCallable[IsTaskTemplate], callable_decorator_cls(cls))
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/tasklist_job/index.html b/docs/mkdocs_site/reference/omnipy/compute/tasklist_job/index.html new file mode 100644 index 00000000..2428ff63 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/tasklist_job/index.html @@ -0,0 +1,2508 @@ + + + + + + + + + + + + + + + + + + + + + + tasklist_job - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

tasklist_job

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ TaskTemplateArgsJobBase + + +

+ + +
+

+ Bases: FuncArgJobBase

+ + + +
+ Source code in src/omnipy/compute/tasklist_job.py +
10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
class TaskTemplateArgsJobBase(FuncArgJobBase):
+    def __init__(self, job_func: Callable, *task_templates: IsTaskTemplate,
+                 **kwargs: object) -> None:
+        self._task_templates: Tuple[IsTaskTemplate, ...] = task_templates
+
+    def _get_init_args(self) -> Tuple[object, ...]:
+        return self._job_func, *self._task_templates
+
+    @property
+    def task_templates(self) -> Tuple[IsTaskTemplate, ...]:
+        return self._task_templates
+
+    def _refine(
+            self,
+            *task_templates: IsTaskTemplate,
+            update: bool = True,
+            **kwargs: object
+    ) -> IsTaskTemplateArgsJobTemplate[IsTaskTemplate, IsJobTemplate, IsJob]:
+
+        refined_template = super()._refine(
+            *task_templates,
+            update=update,
+            **kwargs,
+        )
+        return cast(IsTaskTemplateArgsJobTemplate[IsTaskTemplate, IsJobTemplate, IsJob],
+                    refined_template)
+
+
+ + + +
+ + + + + + + +
+ + + +

+task_templates: Tuple[IsTaskTemplate, ...] + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(job_func, *task_templates, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/compute/tasklist_job.py +
11
+12
+13
def __init__(self, job_func: Callable, *task_templates: IsTaskTemplate,
+             **kwargs: object) -> None:
+    self._task_templates: Tuple[IsTaskTemplate, ...] = task_templates
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/compute/typing/index.html b/docs/mkdocs_site/reference/omnipy/compute/typing/index.html new file mode 100644 index 00000000..b6f8af2c --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/compute/typing/index.html @@ -0,0 +1,2465 @@ + + + + + + + + + + + + + + + + + + + + + + typing - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

typing

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+mypy_fix_dag_flow_template(dag_flow_template) + +

+ + +
+ +
+ Source code in src/omnipy/compute/typing.py +
22
+23
def mypy_fix_dag_flow_template(dag_flow_template: object) -> 'IsDagFlowTemplate':
+    return cast('IsDagFlowTemplate', dag_flow_template)
+
+
+
+ +
+ +
+ + + +

+mypy_fix_func_flow_template(func_flow_template) + +

+ + +
+ +
+ Source code in src/omnipy/compute/typing.py +
26
+27
def mypy_fix_func_flow_template(func_flow_template: object) -> 'IsFuncFlowTemplate':
+    return cast('IsFuncFlowTemplate', func_flow_template)
+
+
+
+ +
+ +
+ + + +

+mypy_fix_linear_flow_template(linear_flow_template) + +

+ + +
+ +
+ Source code in src/omnipy/compute/typing.py +
18
+19
def mypy_fix_linear_flow_template(linear_flow_template: object) -> 'IsLinearFlowTemplate':
+    return cast('IsLinearFlowTemplate', linear_flow_template)
+
+
+
+ +
+ +
+ + + +

+mypy_fix_task_template(task_template) + +

+ + +
+ +
+ Source code in src/omnipy/compute/typing.py +
14
+15
def mypy_fix_task_template(task_template: object) -> 'IsTaskTemplate':
+    return cast('IsTaskTemplate', task_template)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/config/engine/index.html b/docs/mkdocs_site/reference/omnipy/config/engine/index.html new file mode 100644 index 00000000..076afbfa --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/config/engine/index.html @@ -0,0 +1,2524 @@ + + + + + + + + + + + + + + + + + + + + + + engine - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

engine

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ EngineConfig + + + + dataclass + + +

+ + +
+ + + +
+ Source code in src/omnipy/config/engine.py +
4
+5
+6
@dataclass
+class EngineConfig:
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ LocalRunnerConfig + + + + dataclass + + +

+ + +
+

+ Bases: EngineConfig

+ + + +
+ Source code in src/omnipy/config/engine.py +
 9
+10
+11
@dataclass
+class LocalRunnerConfig(EngineConfig):
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ PrefectEngineConfig + + + + dataclass + + +

+ + +
+

+ Bases: EngineConfig

+ + + +
+ Source code in src/omnipy/config/engine.py +
14
+15
+16
@dataclass
+class PrefectEngineConfig(EngineConfig):
+    use_cached_results: int = False
+
+
+ + + +
+ + + + + + + +
+ + + +

+use_cached_results: int = False + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/config/index.html b/docs/mkdocs_site/reference/omnipy/config/index.html new file mode 100644 index 00000000..7236151c --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/config/index.html @@ -0,0 +1,2280 @@ + + + + + + + + + + + + + + + + + + + + + + config - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

config

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/config/job/index.html b/docs/mkdocs_site/reference/omnipy/config/job/index.html new file mode 100644 index 00000000..b7e66a26 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/config/job/index.html @@ -0,0 +1,2502 @@ + + + + + + + + + + + + + + + + + + + + + + job - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

job

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ JobConfig + + + + dataclass + + +

+ + +
+ + + +
+ Source code in src/omnipy/config/job.py +
13
+14
+15
+16
+17
+18
+19
@dataclass
+class JobConfig:
+    persist_outputs: ConfigPersistOutputsOptions = \
+        ConfigPersistOutputsOptions.ENABLE_FLOW_AND_TASK_OUTPUTS
+    restore_outputs: ConfigRestoreOutputsOptions = \
+        ConfigRestoreOutputsOptions.DISABLED
+    persist_data_dir_path: str = field(default_factory=_get_persist_data_dir_path)
+
+
+ + + +
+ + + + + + + +
+ + + +

+persist_data_dir_path: str = field(default_factory=_get_persist_data_dir_path) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+persist_outputs: ConfigPersistOutputsOptions = ConfigPersistOutputsOptions.ENABLE_FLOW_AND_TASK_OUTPUTS + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+restore_outputs: ConfigRestoreOutputsOptions = ConfigRestoreOutputsOptions.DISABLED + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/config/root_log/index.html b/docs/mkdocs_site/reference/omnipy/config/root_log/index.html new file mode 100644 index 00000000..a2cedaa1 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/config/root_log/index.html @@ -0,0 +1,2714 @@ + + + + + + + + + + + + + + + + + + + + + + root_log - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

root_log

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ RootLogConfig + + + + dataclass + + +

+ + +
+ + + +
+ Source code in src/omnipy/config/root_log.py +
13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
@dataclass
+class RootLogConfig:
+    log_format_str: str = '{engine} {asctime} - {levelname}: {message} [{name}]'
+    locale: LocaleType = pkg_locale.getlocale()
+    log_to_stdout: bool = True
+    log_to_stderr: bool = True
+    log_to_file: bool = True
+    stdout_log_min_level: int = logging.INFO
+    stderr_log_min_level: int = logging.ERROR
+    file_log_min_level: int = logging.WARNING
+    file_log_dir_path: str = field(default_factory=_get_log_dir_path)
+
+
+ + + +
+ + + + + + + +
+ + + +

+file_log_dir_path: str = field(default_factory=_get_log_dir_path) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+file_log_min_level: int = logging.WARNING + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+locale: LocaleType = pkg_locale.getlocale() + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+log_format_str: str = '{engine} {asctime} - {levelname}: {message} [{name}]' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+log_to_file: bool = True + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+log_to_stderr: bool = True + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+log_to_stdout: bool = True + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+stderr_log_min_level: int = logging.ERROR + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+stdout_log_min_level: int = logging.INFO + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/engine/base/index.html b/docs/mkdocs_site/reference/omnipy/engine/base/index.html new file mode 100644 index 00000000..8d01b5f9 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/engine/base/index.html @@ -0,0 +1,2650 @@ + + + + + + + + + + + + + + + + + + + + + + base - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

base

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ Engine + + +

+ + +
+

+ Bases: ABC

+ + +

Base class for engine implementations

+ + +
+ Source code in src/omnipy/engine/base.py +
 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
class Engine(ABC):
+    """Base class for engine implementations"""
+    def __init__(self) -> None:
+        config_cls = self.get_config_cls()
+        self._config: IsEngineConfig = config_cls()
+        self._registry: Optional[IsRunStateRegistry] = None
+
+        self._init_engine()
+
+    @abstractmethod
+    def _init_engine(self) -> None:
+        """
+        Private method for initialization of an Engine subclass. Removes the need to override the
+        __init__() method in the subclass, reducing class coupling and possible error sources.
+        Must be implemented by all subclasses of Engine, but can remain empty.
+        """
+
+    @abstractmethod
+    def _update_from_config(self) -> None:
+        """
+        Private method to signal to subclass to update any internal state that depends on config
+        values.
+        Must be implemented by all subclasses of Engine, but can remain empty.
+        """
+
+    @classmethod
+    @abstractmethod
+    def get_config_cls(cls) -> Type[IsEngineConfig]:
+        """
+        Specification of config class mapped to an Engine subclass. Must be implemented by all
+        subclasses of Engine. If no configuration is needed, then the EngineConfig class should be
+        returned.
+        :return: Class implementing the IsEngineConfig protocol
+        """
+
+    def set_config(self, config: IsEngineConfig) -> None:
+        self._config = config
+        self._update_from_config()
+
+    def set_registry(self, registry: Optional[IsRunStateRegistry]) -> None:
+        self._registry = registry
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__init__() + +

+ + +
+ +
+ Source code in src/omnipy/engine/base.py +
10
+11
+12
+13
+14
+15
def __init__(self) -> None:
+    config_cls = self.get_config_cls()
+    self._config: IsEngineConfig = config_cls()
+    self._registry: Optional[IsRunStateRegistry] = None
+
+    self._init_engine()
+
+
+
+ +
+ +
+ + + +

+get_config_cls() + + + classmethod + abstractmethod + + +

+ + +
+ +

Specification of config class mapped to an Engine subclass. Must be implemented by all +subclasses of Engine. If no configuration is needed, then the EngineConfig class should be +returned. +:return: Class implementing the IsEngineConfig protocol

+ +
+ Source code in src/omnipy/engine/base.py +
33
+34
+35
+36
+37
+38
+39
+40
+41
@classmethod
+@abstractmethod
+def get_config_cls(cls) -> Type[IsEngineConfig]:
+    """
+    Specification of config class mapped to an Engine subclass. Must be implemented by all
+    subclasses of Engine. If no configuration is needed, then the EngineConfig class should be
+    returned.
+    :return: Class implementing the IsEngineConfig protocol
+    """
+
+
+
+ +
+ +
+ + + +

+set_config(config) + +

+ + +
+ +
+ Source code in src/omnipy/engine/base.py +
43
+44
+45
def set_config(self, config: IsEngineConfig) -> None:
+    self._config = config
+    self._update_from_config()
+
+
+
+ +
+ +
+ + + +

+set_registry(registry) + +

+ + +
+ +
+ Source code in src/omnipy/engine/base.py +
47
+48
def set_registry(self, registry: Optional[IsRunStateRegistry]) -> None:
+    self._registry = registry
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/engine/index.html b/docs/mkdocs_site/reference/omnipy/engine/index.html new file mode 100644 index 00000000..4106c108 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/engine/index.html @@ -0,0 +1,2280 @@ + + + + + + + + + + + + + + + + + + + + + + engine - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

engine

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/engine/job_runner/index.html b/docs/mkdocs_site/reference/omnipy/engine/job_runner/index.html new file mode 100644 index 00000000..93cdc24a --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/engine/job_runner/index.html @@ -0,0 +1,3492 @@ + + + + + + + + + + + + + + + + + + + + + + job_runner - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

job_runner

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ DagFlowRunnerEngine + + +

+ + +
+

+ Bases: JobRunnerEngine

+ + +

Base class for DAG flow runner engine implementations

+ + +
+ Source code in src/omnipy/engine/job_runner.py +
133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
class DagFlowRunnerEngine(JobRunnerEngine):
+    """Base class for DAG flow runner engine implementations"""
+    def apply_dag_flow_decorator(self, dag_flow: IsDagFlow,
+                                 job_callback_accept_decorator: Callable) -> None:
+        def _dag_flow_decorator(call_func: Callable) -> Callable:
+            self._register_job_state(dag_flow, RunState.INITIALIZED)
+            state = self._init_dag_flow(dag_flow)
+
+            def _dag_flow_runner_call_func(*args: object, **kwargs: object) -> Any:
+                self._register_job_state(dag_flow, RunState.RUNNING)
+                flow_result = self._run_dag_flow(state, dag_flow, *args, **kwargs)
+                return self._decorate_result_with_job_finalization_detector(dag_flow, flow_result)
+
+            return _dag_flow_runner_call_func
+
+        job_callback_accept_decorator(_dag_flow_decorator)
+
+    @staticmethod
+    def default_dag_flow_run_decorator(dag_flow: IsDagFlow) -> Any:
+        def _inner_run_dag_flow(*args: object, **kwargs: object):
+            results = {}
+            result = None
+            with dag_flow.flow_context:
+                for i, job in enumerate(dag_flow.task_templates):
+                    if i == 0:
+                        results = dag_flow.get_call_args(*args, **kwargs)
+
+                    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():
+                            if key in param_keys:
+                                param_keys.remove(key)
+                                param_keys.add(val)
+
+                    if hasattr(job, 'fixed_params'):
+                        for key in job.fixed_params.keys():
+                            if key in param_keys:
+                                param_keys.remove(key)
+
+                    params = {key: val for key, val in results.items() if key in param_keys}
+                    result = job(**params)
+
+                    if isinstance(result, dict) and len(result) > 0:
+                        results.update(result)
+                    else:
+                        results[job.name] = result
+            return result
+
+        return _inner_run_dag_flow
+
+    @abstractmethod
+    def _init_dag_flow(self, dag_flow: IsDagFlow) -> Any:
+        ...
+
+    @abstractmethod
+    def _run_dag_flow(self, state: Any, dag_flow: IsDagFlow, *args, **kwargs) -> Any:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply_dag_flow_decorator(dag_flow, job_callback_accept_decorator) + +

+ + +
+ +
+ Source code in src/omnipy/engine/job_runner.py +
135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
def apply_dag_flow_decorator(self, dag_flow: IsDagFlow,
+                             job_callback_accept_decorator: Callable) -> None:
+    def _dag_flow_decorator(call_func: Callable) -> Callable:
+        self._register_job_state(dag_flow, RunState.INITIALIZED)
+        state = self._init_dag_flow(dag_flow)
+
+        def _dag_flow_runner_call_func(*args: object, **kwargs: object) -> Any:
+            self._register_job_state(dag_flow, RunState.RUNNING)
+            flow_result = self._run_dag_flow(state, dag_flow, *args, **kwargs)
+            return self._decorate_result_with_job_finalization_detector(dag_flow, flow_result)
+
+        return _dag_flow_runner_call_func
+
+    job_callback_accept_decorator(_dag_flow_decorator)
+
+
+
+ +
+ +
+ + + +

+default_dag_flow_run_decorator(dag_flow) + + + staticmethod + + +

+ + +
+ +
+ Source code in src/omnipy/engine/job_runner.py +
150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
@staticmethod
+def default_dag_flow_run_decorator(dag_flow: IsDagFlow) -> Any:
+    def _inner_run_dag_flow(*args: object, **kwargs: object):
+        results = {}
+        result = None
+        with dag_flow.flow_context:
+            for i, job in enumerate(dag_flow.task_templates):
+                if i == 0:
+                    results = dag_flow.get_call_args(*args, **kwargs)
+
+                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():
+                        if key in param_keys:
+                            param_keys.remove(key)
+                            param_keys.add(val)
+
+                if hasattr(job, 'fixed_params'):
+                    for key in job.fixed_params.keys():
+                        if key in param_keys:
+                            param_keys.remove(key)
+
+                params = {key: val for key, val in results.items() if key in param_keys}
+                result = job(**params)
+
+                if isinstance(result, dict) and len(result) > 0:
+                    results.update(result)
+                else:
+                    results[job.name] = result
+        return result
+
+    return _inner_run_dag_flow
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ FuncFlowRunnerEngine + + +

+ + +
+

+ Bases: JobRunnerEngine

+ + +

Base class for function flow runner engine implementations

+ + +
+ Source code in src/omnipy/engine/job_runner.py +
195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
class FuncFlowRunnerEngine(JobRunnerEngine):
+    """Base class for function flow runner engine implementations"""
+    def apply_func_flow_decorator(self,
+                                  func_flow: IsFuncFlow,
+                                  job_callback_accept_decorator: Callable) -> None:
+        def _func_flow_decorator(call_func: Callable) -> Callable:
+            self._register_job_state(func_flow, RunState.INITIALIZED)
+            state = self._init_func_flow(func_flow, call_func)
+
+            def _func_flow_runner_call_func(*args: object, **kwargs: object) -> Any:
+                self._register_job_state(func_flow, RunState.RUNNING)
+                with func_flow.flow_context:
+                    flow_result = self._run_func_flow(state, func_flow, call_func, *args, **kwargs)
+                    return self._decorate_result_with_job_finalization_detector(
+                        func_flow, flow_result)
+
+            return _func_flow_runner_call_func
+
+        job_callback_accept_decorator(_func_flow_decorator)
+
+    @abstractmethod
+    def _init_func_flow(self, func_flow: IsFuncFlow, call_func: Callable) -> object:
+        ...
+
+    @abstractmethod
+    def _run_func_flow(self,
+                       state: Any,
+                       func_flow: IsFuncFlow,
+                       call_func: Callable,
+                       *args,
+                       **kwargs) -> Any:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply_func_flow_decorator(func_flow, job_callback_accept_decorator) + +

+ + +
+ +
+ Source code in src/omnipy/engine/job_runner.py +
197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
def apply_func_flow_decorator(self,
+                              func_flow: IsFuncFlow,
+                              job_callback_accept_decorator: Callable) -> None:
+    def _func_flow_decorator(call_func: Callable) -> Callable:
+        self._register_job_state(func_flow, RunState.INITIALIZED)
+        state = self._init_func_flow(func_flow, call_func)
+
+        def _func_flow_runner_call_func(*args: object, **kwargs: object) -> Any:
+            self._register_job_state(func_flow, RunState.RUNNING)
+            with func_flow.flow_context:
+                flow_result = self._run_func_flow(state, func_flow, call_func, *args, **kwargs)
+                return self._decorate_result_with_job_finalization_detector(
+                    func_flow, flow_result)
+
+        return _func_flow_runner_call_func
+
+    job_callback_accept_decorator(_func_flow_decorator)
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ JobRunnerEngine + + +

+ + +
+

+ Bases: Engine, ABC

+ + +

Base class for job runner engine implementations

+ + +
+ Source code in src/omnipy/engine/job_runner.py +
13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
class JobRunnerEngine(Engine, ABC):
+    """Base class for job runner engine implementations"""
+    def _register_job_state(self, job: IsJob, state: RunState) -> None:
+        if self._registry:
+            self._registry.set_job_state(job, state)
+
+    def _decorate_result_with_job_finalization_detector(self, job: IsJob, job_result: object):
+        if isinstance(job_result, GeneratorType):
+            job_result = cast(GeneratorType, job_result)
+
+            def detect_finished_generator_decorator():
+                try:
+                    value = yield next(job_result)
+                    while True:
+                        value = yield job_result.send(value)
+                except StopIteration:
+                    self._register_job_state(job, RunState.FINISHED)
+
+            return detect_finished_generator_decorator()
+        elif isinstance(job_result, AsyncGeneratorType):
+            job_result = cast(AsyncGeneratorType, job_result)
+
+            async def detect_finished_async_generator_decorator():
+                try:
+                    if sys.version_info >= (3, 10):
+                        value = yield await anext(job_result)
+                    else:
+                        value = yield await job_result.__anext__()
+                    while True:
+                        value = yield await job_result.asend(value)
+                except StopAsyncIteration:
+                    self._register_job_state(job, RunState.FINISHED)
+
+            return detect_finished_async_generator_decorator()
+
+        elif inspect.isawaitable(job_result):
+            job_result = cast(Awaitable, job_result)
+
+            async def detect_finished_coroutine():
+                result = await job_result
+                self._register_job_state(job, RunState.FINISHED)
+                return result
+
+            return detect_finished_coroutine()
+        else:
+            self._register_job_state(job, RunState.FINISHED)
+            return job_result
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ LinearFlowRunnerEngine + + +

+ + +
+

+ Bases: JobRunnerEngine

+ + +

Base class for linear flow runner engine implementations

+ + +
+ Source code in src/omnipy/engine/job_runner.py +
 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
class LinearFlowRunnerEngine(JobRunnerEngine):
+    """Base class for linear flow runner engine implementations"""
+    def apply_linear_flow_decorator(self,
+                                    linear_flow: IsLinearFlow,
+                                    job_callback_accept_decorator: Callable) -> None:
+        def _linear_flow_decorator(call_func: Callable) -> Callable:
+            self._register_job_state(linear_flow, RunState.INITIALIZED)
+            state = self._init_linear_flow(linear_flow)
+
+            def _linear_flow_runner_call_func(*args: object, **kwargs: object) -> Any:
+                self._register_job_state(linear_flow, RunState.RUNNING)
+                flow_result = self._run_linear_flow(state, linear_flow, *args, **kwargs)
+                return self._decorate_result_with_job_finalization_detector(
+                    linear_flow, flow_result)
+
+            return _linear_flow_runner_call_func
+
+        job_callback_accept_decorator(_linear_flow_decorator)
+
+    @staticmethod
+    def default_linear_flow_run_decorator(linear_flow: IsLinearFlow) -> Any:
+        def _inner_run_linear_flow(*args: object, **kwargs: object):
+
+            result = None
+            with linear_flow.flow_context:
+                for i, job in enumerate(linear_flow.task_templates):
+                    # TODO: Better handling of kwargs
+                    if i == 0:
+                        result = job(*args, **kwargs)
+                    else:
+                        result = job(*args)
+
+                    args = (result,)
+            return result
+
+        return _inner_run_linear_flow
+
+    @abstractmethod
+    def _init_linear_flow(self, linear_flow: IsLinearFlow) -> Any:
+        ...
+
+    @abstractmethod
+    def _run_linear_flow(self, state: Any, linear_flow: IsLinearFlow, *args, **kwargs) -> Any:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply_linear_flow_decorator(linear_flow, job_callback_accept_decorator) + +

+ + +
+ +
+ Source code in src/omnipy/engine/job_runner.py +
 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
def apply_linear_flow_decorator(self,
+                                linear_flow: IsLinearFlow,
+                                job_callback_accept_decorator: Callable) -> None:
+    def _linear_flow_decorator(call_func: Callable) -> Callable:
+        self._register_job_state(linear_flow, RunState.INITIALIZED)
+        state = self._init_linear_flow(linear_flow)
+
+        def _linear_flow_runner_call_func(*args: object, **kwargs: object) -> Any:
+            self._register_job_state(linear_flow, RunState.RUNNING)
+            flow_result = self._run_linear_flow(state, linear_flow, *args, **kwargs)
+            return self._decorate_result_with_job_finalization_detector(
+                linear_flow, flow_result)
+
+        return _linear_flow_runner_call_func
+
+    job_callback_accept_decorator(_linear_flow_decorator)
+
+
+
+ +
+ +
+ + + +

+default_linear_flow_run_decorator(linear_flow) + + + staticmethod + + +

+ + +
+ +
+ Source code in src/omnipy/engine/job_runner.py +
106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
@staticmethod
+def default_linear_flow_run_decorator(linear_flow: IsLinearFlow) -> Any:
+    def _inner_run_linear_flow(*args: object, **kwargs: object):
+
+        result = None
+        with linear_flow.flow_context:
+            for i, job in enumerate(linear_flow.task_templates):
+                # TODO: Better handling of kwargs
+                if i == 0:
+                    result = job(*args, **kwargs)
+                else:
+                    result = job(*args)
+
+                args = (result,)
+        return result
+
+    return _inner_run_linear_flow
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ TaskRunnerEngine + + +

+ + +
+

+ Bases: JobRunnerEngine

+ + +

Base class for task runner engine implementations

+ + +
+ Source code in src/omnipy/engine/job_runner.py +
62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
class TaskRunnerEngine(JobRunnerEngine):
+    """Base class for task runner engine implementations"""
+    def apply_task_decorator(self, task: IsTask, job_callback_accept_decorator: Callable) -> None:
+        def _task_decorator(call_func: Callable) -> Callable:
+            self._register_job_state(task, RunState.INITIALIZED)
+            state = self._init_task(task, call_func)
+
+            def _task_runner_call_func(*args: Any, **kwargs: Any) -> Any:
+                self._register_job_state(task, RunState.RUNNING)
+                task_result = self._run_task(state, task, call_func, *args, **kwargs)
+                return self._decorate_result_with_job_finalization_detector(task, task_result)
+
+            return _task_runner_call_func
+
+        job_callback_accept_decorator(_task_decorator)
+
+    @abstractmethod
+    def _init_task(self, task: IsTask, call_func: Callable) -> Any:
+        ...
+
+    @abstractmethod
+    def _run_task(self, state: Any, task: IsTask, call_func: Callable, *args, **kwargs) -> Any:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+apply_task_decorator(task, job_callback_accept_decorator) + +

+ + +
+ +
+ Source code in src/omnipy/engine/job_runner.py +
64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
def apply_task_decorator(self, task: IsTask, job_callback_accept_decorator: Callable) -> None:
+    def _task_decorator(call_func: Callable) -> Callable:
+        self._register_job_state(task, RunState.INITIALIZED)
+        state = self._init_task(task, call_func)
+
+        def _task_runner_call_func(*args: Any, **kwargs: Any) -> Any:
+            self._register_job_state(task, RunState.RUNNING)
+            task_result = self._run_task(state, task, call_func, *args, **kwargs)
+            return self._decorate_result_with_job_finalization_detector(task, task_result)
+
+        return _task_runner_call_func
+
+    job_callback_accept_decorator(_task_decorator)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/engine/local/index.html b/docs/mkdocs_site/reference/omnipy/engine/local/index.html new file mode 100644 index 00000000..af036328 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/engine/local/index.html @@ -0,0 +1,2517 @@ + + + + + + + + + + + + + + + + + + + + + + local - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

local

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ LocalRunner + + +

+ + +
+

+ Bases: TaskRunnerEngine, LinearFlowRunnerEngine, DagFlowRunnerEngine, FuncFlowRunnerEngine

+ + +

Local job runner

+ + +
+ Source code in src/omnipy/engine/local.py +
12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
class LocalRunner(TaskRunnerEngine,
+                  LinearFlowRunnerEngine,
+                  DagFlowRunnerEngine,
+                  FuncFlowRunnerEngine):
+    """Local job runner"""
+    def _init_engine(self) -> None:
+        ...
+
+    def _update_from_config(self) -> None:
+        ...
+
+    @classmethod
+    def get_config_cls(cls) -> Type[IsLocalRunnerConfig]:
+        return LocalRunnerConfig
+
+    def _init_task(self, task: IsTask, call_func: Callable) -> Any:
+        ...
+
+    def _run_task(self, state: Any, task: IsTask, call_func: Callable, *args, **kwargs) -> Any:
+        return call_func(*args, **kwargs)
+
+    def _init_linear_flow(self, flow: IsLinearFlow) -> Any:
+        ...
+
+    def _run_linear_flow(self, state: Any, flow: IsLinearFlow, *args, **kwargs) -> Any:
+        return self.default_linear_flow_run_decorator(flow)(*args, **kwargs)
+
+    def _init_dag_flow(self, flow: IsDagFlow) -> Any:
+        ...
+
+    def _run_dag_flow(self, state: Any, flow: IsDagFlow, *args, **kwargs) -> Any:
+        return self.default_dag_flow_run_decorator(flow)(*args, **kwargs)
+
+    def _init_func_flow(self, func_flow: IsFuncFlow, call_func: Callable) -> object:
+        pass
+
+    def _run_func_flow(self,
+                       state: Any,
+                       func_flow: IsFuncFlow,
+                       call_func: Callable,
+                       *args,
+                       **kwargs) -> Any:
+        with func_flow.flow_context:
+            return call_func(*args, **kwargs)
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+get_config_cls() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/engine/local.py +
23
+24
+25
@classmethod
+def get_config_cls(cls) -> Type[IsLocalRunnerConfig]:
+    return LocalRunnerConfig
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/hub/entry/index.html b/docs/mkdocs_site/reference/omnipy/hub/entry/index.html new file mode 100644 index 00000000..13e93605 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/hub/entry/index.html @@ -0,0 +1,2449 @@ + + + + + + + + + + + + + + + + + + + + + + entry - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

entry

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ RuntimeEntryPublisher + + + + dataclass + + +

+ + +
+

+ Bases: DataPublisher

+ + + +
+ Source code in src/omnipy/hub/entry.py +
 8
+ 9
+10
+11
+12
+13
+14
+15
+16
@dataclass
+class RuntimeEntryPublisher(DataPublisher):
+    _back: Optional[IsRuntime] = field(default=None, init=False, repr=False)
+
+    def __setattr__(self, key, value):
+        super().__setattr__(key, value)
+
+        if hasattr(self, key) and not key.startswith('_') and self._back is not None:
+            self._back.reset_subscriptions()
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__setattr__(key, value) + +

+ + +
+ +
+ Source code in src/omnipy/hub/entry.py +
12
+13
+14
+15
+16
def __setattr__(self, key, value):
+    super().__setattr__(key, value)
+
+    if hasattr(self, key) and not key.startswith('_') and self._back is not None:
+        self._back.reset_subscriptions()
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/hub/index.html b/docs/mkdocs_site/reference/omnipy/hub/index.html new file mode 100644 index 00000000..95eb30bb --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/hub/index.html @@ -0,0 +1,2280 @@ + + + + + + + + + + + + + + + + + + + + + + hub - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

hub

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/hub/root_log/index.html b/docs/mkdocs_site/reference/omnipy/hub/root_log/index.html new file mode 100644 index 00000000..c20bb5bc --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/hub/root_log/index.html @@ -0,0 +1,2825 @@ + + + + + + + + + + + + + + + + + + + + + + root_log - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

root_log

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ RootLogConfigEntryPublisher + + + + dataclass + + +

+ + +
+

+ Bases: RootLogConfig, RuntimeEntryPublisher

+ + + +
+ Source code in src/omnipy/hub/root_log.py +
16
+17
+18
@dataclass
+class RootLogConfigEntryPublisher(RootLogConfig, RuntimeEntryPublisher):
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ RootLogObjects + + + + dataclass + + +

+ + +
+ + + +
+ Source code in src/omnipy/hub/root_log.py +
 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
@dataclass
+class RootLogObjects:
+    _config: IsRootLogConfig = field(
+        init=False, repr=False, default_factory=RootLogConfigEntryPublisher)
+
+    formatter: Optional[logging.Formatter] = None
+    stdout_handler: Optional[StreamHandler] = None
+    stderr_handler: Optional[StreamHandler] = None
+    file_handler: Optional[TimedRotatingFileHandler] = None
+
+    def __post_init__(self):
+        self._configure_all_objects()
+
+    def set_config(self, config: IsRootLogConfig):
+        self._config = config
+        self._configure_all_objects()
+
+    def _configure_all_objects(self):
+        self._remove_all_handlers_from_root_logger()
+
+        self._configure_formatter()
+        self._configure_stdout_handler()
+        self._configure_stderr_handler()
+        self._configure_file_handler()
+
+        self._add_all_handlers_to_root_logger()
+
+    def _configure_formatter(self):
+        if self._config.log_format_str:
+            datetime_fmt = get_datetime_format(self._config.locale)
+            self.formatter = logging.Formatter(self._config.log_format_str, datetime_fmt, style='{')
+        else:
+            self.formatter = None
+
+    def _configure_stdout_handler(self):
+        if self._config.log_to_stdout:
+            config = self._config
+
+            class StdErrBasedMaxLevelFilter(logging.Filter):
+                def filter(self, record):
+                    return record.levelno < config.stderr_log_min_level
+
+            self.stdout_handler = StreamHandler(stdout)
+            self.stdout_handler.setLevel(self._config.stdout_log_min_level)
+            if self._config.log_to_stderr:
+                self.stdout_handler.addFilter(StdErrBasedMaxLevelFilter())
+        else:
+            self.stdout_handler = None
+
+    def _configure_stderr_handler(self) -> Optional[StreamHandler]:
+        if self._config.log_to_stderr:
+            self.stderr_handler = StreamHandler(stderr)
+            self.stderr_handler.setLevel(self._config.stderr_log_min_level)
+        else:
+            self.stderr_handler = None
+
+    def _configure_file_handler(self) -> Optional[TimedRotatingFileHandler]:
+        if self._config.log_to_file:
+            log_dir_path = self._config.file_log_dir_path
+            if not os.path.exists(log_dir_path):
+                os.makedirs(log_dir_path)
+
+            log_file_path = Path(log_dir_path).joinpath('omnipy.log')
+            self.file_handler = TimedRotatingFileHandler(
+                log_file_path, when='d', interval=1, backupCount=7)
+            self.file_handler.setLevel(self._config.file_log_min_level)
+        else:
+            self.file_handler = None
+
+    def _remove_all_handlers_from_root_logger(self):
+        root_logger = logging.root
+        handlersToRemove = [
+            handler for handler in root_logger.handlers
+            if isinstance(handler, StreamHandler) or isinstance(handler, TimedRotatingFileHandler)
+        ]
+        for handler in handlersToRemove:
+            root_logger.removeHandler(handler)
+
+    def _add_handler_to_root_logger(self, handler: Optional[logging.Handler]):
+        if handler:
+            root_logger = logging.root
+            if self.formatter:
+                handler.setFormatter(self.formatter)
+            root_logger.addHandler(handler)
+
+    def _add_all_handlers_to_root_logger(self):
+        self._add_handler_to_root_logger(self.stdout_handler)
+        self._add_handler_to_root_logger(self.stderr_handler)
+        self._add_handler_to_root_logger(self.file_handler)
+
+
+ + + +
+ + + + + + + +
+ + + +

+file_handler: Optional[TimedRotatingFileHandler] = None + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+formatter: Optional[logging.Formatter] = None + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+stderr_handler: Optional[StreamHandler] = None + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+stdout_handler: Optional[StreamHandler] = None + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+__post_init__() + +

+ + +
+ +
+ Source code in src/omnipy/hub/root_log.py +
31
+32
def __post_init__(self):
+    self._configure_all_objects()
+
+
+
+ +
+ +
+ + + +

+set_config(config) + +

+ + +
+ +
+ Source code in src/omnipy/hub/root_log.py +
34
+35
+36
def set_config(self, config: IsRootLogConfig):
+    self._config = config
+    self._configure_all_objects()
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/hub/runtime/index.html b/docs/mkdocs_site/reference/omnipy/hub/runtime/index.html new file mode 100644 index 00000000..469819cd --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/hub/runtime/index.html @@ -0,0 +1,3216 @@ + + + + + + + + + + + + + + + + + + + + + + runtime - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

runtime

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ Runtime + + + + dataclass + + +

+ + +
+

+ Bases: DataPublisher

+ + + +
+ Source code in src/omnipy/hub/runtime.py +
 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
@dataclass
+class Runtime(DataPublisher):
+    config: IsRuntimeConfig = field(default_factory=RuntimeConfig)
+    objects: IsRuntimeObjects = field(default_factory=RuntimeObjects)
+
+    def __post_init__(self):
+        super().__init__()
+
+        self.config._back = self
+        self.config.root_log._back = self
+        self.objects._back = self
+
+        self.reset_subscriptions()
+
+    def reset_subscriptions(self):
+        self.config.unsubscribe_all()
+        self.objects.unsubscribe_all()
+
+        self.config.subscribe('job', self.objects.job_creator.set_config)
+        self.config.subscribe('local', self.objects.local.set_config)
+        self.config.subscribe('prefect', self.objects.prefect.set_config)
+        self.config.subscribe('root_log', self.objects.root_log.set_config)
+
+        self.config.subscribe('local', self._update_job_creator_engine)
+        self.config.subscribe('prefect', self._update_job_creator_engine)
+        self.config.subscribe('engine', self._update_job_creator_engine)
+
+        self.objects.subscribe('registry', self.objects.local.set_registry)
+        self.objects.subscribe('registry', self.objects.prefect.set_registry)
+
+        self.objects.subscribe('local', self._update_local_runner_config)
+        self.objects.subscribe('prefect', self._update_prefect_engine_config)
+
+    def _get_engine_config(self, engine_choice: EngineChoice):
+        return getattr(self.config, engine_choice)
+
+    def _set_engine_config(self, engine_choice: EngineChoice, engine_config: IsEngineConfig):
+        return setattr(self.config, engine_choice, engine_config)
+
+    def _get_engine(self, engine_choice: EngineChoice):
+        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:
+            self._set_engine_config(engine_choice, engine_config_cls())
+
+    def _update_local_runner_config(self, local_runner: IsEngine):
+        self._new_engine_config_if_new_cls(local_runner, EngineChoice.LOCAL)
+
+    def _update_prefect_engine_config(self, prefect_engine: IsEngine):
+        self._new_engine_config_if_new_cls(prefect_engine, EngineChoice.PREFECT)
+
+    def _update_job_creator_engine(self, _item_changed: Any):
+        self.objects.job_creator.set_engine(self._get_engine(self.config.engine))
+
+    def _create_serializer_registry(self):
+        registry = SerializerRegistry()
+
+        registry.register(PandasDatasetToTarFileSerializer)
+        registry.register(RawDatasetToTarFileSerializer)
+        registry.register(JsonDatasetToTarFileSerializer)
+
+        return registry
+
+
+ + + +
+ + + + + + + +
+ + + +

+config: IsRuntimeConfig = field(default_factory=RuntimeConfig) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+objects: IsRuntimeObjects = field(default_factory=RuntimeObjects) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+__post_init__() + +

+ + +
+ +
+ Source code in src/omnipy/hub/runtime.py +
54
+55
+56
+57
+58
+59
+60
+61
def __post_init__(self):
+    super().__init__()
+
+    self.config._back = self
+    self.config.root_log._back = self
+    self.objects._back = self
+
+    self.reset_subscriptions()
+
+
+
+ +
+ +
+ + + +

+reset_subscriptions() + +

+ + +
+ +
+ Source code in src/omnipy/hub/runtime.py +
63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
def reset_subscriptions(self):
+    self.config.unsubscribe_all()
+    self.objects.unsubscribe_all()
+
+    self.config.subscribe('job', self.objects.job_creator.set_config)
+    self.config.subscribe('local', self.objects.local.set_config)
+    self.config.subscribe('prefect', self.objects.prefect.set_config)
+    self.config.subscribe('root_log', self.objects.root_log.set_config)
+
+    self.config.subscribe('local', self._update_job_creator_engine)
+    self.config.subscribe('prefect', self._update_job_creator_engine)
+    self.config.subscribe('engine', self._update_job_creator_engine)
+
+    self.objects.subscribe('registry', self.objects.local.set_registry)
+    self.objects.subscribe('registry', self.objects.prefect.set_registry)
+
+    self.objects.subscribe('local', self._update_local_runner_config)
+    self.objects.subscribe('prefect', self._update_prefect_engine_config)
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ RuntimeConfig + + + + dataclass + + +

+ + +
+

+ Bases: RuntimeEntryPublisher

+ + + +
+ Source code in src/omnipy/hub/runtime.py +
31
+32
+33
+34
+35
+36
+37
@dataclass
+class RuntimeConfig(RuntimeEntryPublisher):
+    job: IsJobConfig = field(default_factory=JobConfig)
+    engine: EngineChoice = EngineChoice.LOCAL
+    local: IsLocalRunnerConfig = field(default_factory=LocalRunnerConfig)
+    prefect: IsPrefectEngineConfig = field(default_factory=PrefectEngineConfig)
+    root_log: IsRootLogConfig = field(default_factory=RootLogConfigEntryPublisher)
+
+
+ + + +
+ + + + + + + +
+ + + +

+engine: EngineChoice = EngineChoice.LOCAL + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+job: IsJobConfig = field(default_factory=JobConfig) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+local: IsLocalRunnerConfig = field(default_factory=LocalRunnerConfig) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+prefect: IsPrefectEngineConfig = field(default_factory=PrefectEngineConfig) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+root_log: IsRootLogConfig = field(default_factory=RootLogConfigEntryPublisher) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ +
+ + + +

+ RuntimeObjects + + + + dataclass + + +

+ + +
+

+ Bases: RuntimeEntryPublisher

+ + + +
+ Source code in src/omnipy/hub/runtime.py +
40
+41
+42
+43
+44
+45
+46
@dataclass
+class RuntimeObjects(RuntimeEntryPublisher):
+    job_creator: IsJobConfigHolder = field(default_factory=_job_creator_factory)
+    local: IsEngine = field(default_factory=LocalRunner)
+    prefect: IsEngine = field(default_factory=PrefectEngine)
+    registry: IsRunStateRegistry = field(default_factory=RunStateRegistry)
+    root_log: IsRootLogObjects = field(default_factory=RootLogObjects)
+
+
+ + + +
+ + + + + + + +
+ + + +

+job_creator: IsJobConfigHolder = field(default_factory=_job_creator_factory) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+local: IsEngine = field(default_factory=LocalRunner) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+prefect: IsEngine = field(default_factory=PrefectEngine) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+registry: IsRunStateRegistry = field(default_factory=RunStateRegistry) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+root_log: IsRootLogObjects = field(default_factory=RootLogObjects) + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/index.html b/docs/mkdocs_site/reference/omnipy/index.html new file mode 100644 index 00000000..7e4cc32c --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/index.html @@ -0,0 +1,2356 @@ + + + + + + + + + + + + + + + + + + + + + + omnipy - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

omnipy

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+__version__ = '0.10.4' + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+runtime: Optional[Runtime] = _get_runtime() + + + module-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/log/constants/index.html b/docs/mkdocs_site/reference/omnipy/log/constants/index.html new file mode 100644 index 00000000..af9be3f2 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/log/constants/index.html @@ -0,0 +1,2350 @@ + + + + + + + + + + + + + + + + + + + + + + constants - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

constants

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+OMNIPY_LOG_FORMAT_STR: str = '%(levelname)s - %(message)s (%(name)s)' + + + module-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/log/index.html b/docs/mkdocs_site/reference/omnipy/log/index.html new file mode 100644 index 00000000..9bc0ad71 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/log/index.html @@ -0,0 +1,2280 @@ + + + + + + + + + + + + + + + + + + + + + + log - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

log

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/log/mixin/index.html b/docs/mkdocs_site/reference/omnipy/log/mixin/index.html new file mode 100644 index 00000000..21c0d674 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/log/mixin/index.html @@ -0,0 +1,2573 @@ + + + + + + + + + + + + + + + + + + + + + + mixin - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

mixin

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ LogMixin + + +

+ + +
+ + + +
+ Source code in src/omnipy/log/mixin.py +
 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
class LogMixin:
+    def __init__(self) -> None:
+        self._logger: Logger = getLogger(f'{self.__class__.__module__}.{self.__class__.__name__}')
+        self._logger.setLevel(INFO)
+
+    @property
+    def logger(self) -> Logger:
+        return self._logger
+
+    def log(self, log_msg: str, level: int = INFO, datetime_obj: Optional[datetime] = None):
+        if self._logger is not None:
+            create_time = time.mktime(datetime_obj.timetuple()) if datetime_obj else time.time()
+            _former_log_record_factory = logging.getLogRecordFactory()
+            if _former_log_record_factory.__name__ != '_log_record_editor':
+
+                def _log_record_editor(*args, **kwargs):
+                    record = _former_log_record_factory(*args, **kwargs)
+                    record.created = create_time
+                    record.engine = f"[{record.name.split('.')[0].upper()}]"
+                    if len(record.engine) < 9:
+                        record.engine += ' '
+                    return record
+
+                logging.setLogRecordFactory(_log_record_editor)
+
+            self._logger.log(level, log_msg)
+
+
+ + + +
+ + + + + + + +
+ + + +

+logger: Logger + + + property + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__() + +

+ + +
+ +
+ Source code in src/omnipy/log/mixin.py +
 9
+10
+11
def __init__(self) -> None:
+    self._logger: Logger = getLogger(f'{self.__class__.__module__}.{self.__class__.__name__}')
+    self._logger.setLevel(INFO)
+
+
+
+ +
+ +
+ + + +

+log(log_msg, level=INFO, datetime_obj=None) + +

+ + +
+ +
+ Source code in src/omnipy/log/mixin.py +
17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
def log(self, log_msg: str, level: int = INFO, datetime_obj: Optional[datetime] = None):
+    if self._logger is not None:
+        create_time = time.mktime(datetime_obj.timetuple()) if datetime_obj else time.time()
+        _former_log_record_factory = logging.getLogRecordFactory()
+        if _former_log_record_factory.__name__ != '_log_record_editor':
+
+            def _log_record_editor(*args, **kwargs):
+                record = _former_log_record_factory(*args, **kwargs)
+                record.created = create_time
+                record.engine = f"[{record.name.split('.')[0].upper()}]"
+                if len(record.engine) < 9:
+                    record.engine += ' '
+                return record
+
+            logging.setLogRecordFactory(_log_record_editor)
+
+        self._logger.log(level, log_msg)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/log/registry/index.html b/docs/mkdocs_site/reference/omnipy/log/registry/index.html new file mode 100644 index 00000000..75f727ac --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/log/registry/index.html @@ -0,0 +1,2755 @@ + + + + + + + + + + + + + + + + + + + + + + registry - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

registry

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ RunStateRegistry + + +

+ + +
+

+ Bases: LogMixin

+ + + +
+ Source code in src/omnipy/log/registry.py +
10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
class RunStateRegistry(LogMixin):
+    def __init__(self) -> None:
+
+        self._jobs: Dict[str, IsUniquelyNamedJob] = {}
+        self._job_states: Dict[str, RunState] = {}
+        self._state_jobs: DefaultDict[RunState, List[str]] = defaultdict(list)
+        self._job_state_datetime: Dict[Tuple[str, RunState], datetime] = {}
+
+        super().__init__()
+
+    def get_job_state(self, job: IsUniquelyNamedJob) -> RunState:
+        return self._job_states[job.unique_name]
+
+    def get_job_state_datetime(self, job: IsUniquelyNamedJob, state: RunState) -> datetime:
+        return self._job_state_datetime[(job.unique_name, state)]
+
+    def all_jobs(self, state: Optional[RunState] = None) -> Tuple[IsUniquelyNamedJob, ...]:
+        if state is not None:
+            job_unique_names = self._state_jobs[state]
+            return tuple(self._jobs[unique_name] for unique_name in job_unique_names)
+        else:
+            return tuple(self._jobs.values())
+
+    def set_job_state(self, job: IsUniquelyNamedJob, state: RunState) -> None:
+        cur_datetime = datetime.now()
+
+        if job.unique_name in self._jobs:
+            self._update_job_registration(job, state)
+        else:
+            self._register_new_job(job, state)
+
+        self._update_job_stats(job, state, cur_datetime)
+        self._log_state_change(job, state)
+
+    def _other_job_registered_with_same_unique_name(self, job: IsUniquelyNamedJob) -> bool:
+        other_job_same_unique_name = self._jobs.get(job.unique_name)
+        return bool(other_job_same_unique_name) and id(other_job_same_unique_name) != id(job)
+
+    def _update_job_registration(self, job: IsUniquelyNamedJob, 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()
+            self._register_new_job(job, state)
+        else:
+            prev_state = self._job_states[job.unique_name]
+            if state == prev_state + 1:
+                self._state_jobs[prev_state].remove(job.unique_name)
+            else:
+                self._raise_job_error(
+                    job,
+                    f'Transitioning from state {prev_state.name} '
+                    f'to state {state.name} is not allowed',
+                )
+
+    def _register_new_job(self, job, state) -> None:
+        if state != RunState.INITIALIZED:
+            self._raise_job_error(
+                job,
+                f'Initial state of must be "INITIALIZED", not "{state.name}"',
+            )
+        self._jobs[job.unique_name] = job
+
+    def _update_job_stats(self, job, state, cur_datetime) -> None:
+        self._job_states[job.unique_name] = state
+        self._state_jobs[state].append(job.unique_name)
+        self._job_state_datetime[(job.unique_name, state)] = cur_datetime
+
+    def _log_state_change(self, job: IsUniquelyNamedJob, state: RunState) -> None:
+        log_msg = RunStateLogMessages[state.name].value.format(job.unique_name)
+        datetime_obj = self.get_job_state_datetime(job, state)
+        self.log(log_msg, datetime_obj=datetime_obj)
+
+    def _raise_job_error(self, job: IsUniquelyNamedJob, msg: str) -> None:
+        raise ValueError(f'Error in job "{job.unique_name}": {msg}')
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__init__() + +

+ + +
+ +
+ Source code in src/omnipy/log/registry.py +
11
+12
+13
+14
+15
+16
+17
+18
def __init__(self) -> None:
+
+    self._jobs: Dict[str, IsUniquelyNamedJob] = {}
+    self._job_states: Dict[str, RunState] = {}
+    self._state_jobs: DefaultDict[RunState, List[str]] = defaultdict(list)
+    self._job_state_datetime: Dict[Tuple[str, RunState], datetime] = {}
+
+    super().__init__()
+
+
+
+ +
+ +
+ + + +

+all_jobs(state=None) + +

+ + +
+ +
+ Source code in src/omnipy/log/registry.py +
26
+27
+28
+29
+30
+31
def all_jobs(self, state: Optional[RunState] = None) -> Tuple[IsUniquelyNamedJob, ...]:
+    if state is not None:
+        job_unique_names = self._state_jobs[state]
+        return tuple(self._jobs[unique_name] for unique_name in job_unique_names)
+    else:
+        return tuple(self._jobs.values())
+
+
+
+ +
+ +
+ + + +

+get_job_state(job) + +

+ + +
+ +
+ Source code in src/omnipy/log/registry.py +
20
+21
def get_job_state(self, job: IsUniquelyNamedJob) -> RunState:
+    return self._job_states[job.unique_name]
+
+
+
+ +
+ +
+ + + +

+get_job_state_datetime(job, state) + +

+ + +
+ +
+ Source code in src/omnipy/log/registry.py +
23
+24
def get_job_state_datetime(self, job: IsUniquelyNamedJob, state: RunState) -> datetime:
+    return self._job_state_datetime[(job.unique_name, state)]
+
+
+
+ +
+ +
+ + + +

+set_job_state(job, state) + +

+ + +
+ +
+ Source code in src/omnipy/log/registry.py +
33
+34
+35
+36
+37
+38
+39
+40
+41
+42
def set_job_state(self, job: IsUniquelyNamedJob, state: RunState) -> None:
+    cur_datetime = datetime.now()
+
+    if job.unique_name in self._jobs:
+        self._update_job_registration(job, state)
+    else:
+        self._register_new_job(job, state)
+
+    self._update_job_stats(job, state, cur_datetime)
+    self._log_state_change(job, state)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/fairtracks/create_filter/index.html b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/create_filter/index.html new file mode 100644 index 00000000..0aab2851 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/create_filter/index.html @@ -0,0 +1,3078 @@ + + + + + + + + + + + + + + + + + + + + + + create_filter - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

create_filter

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+annotations = response.json()['data']['hits'] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+annotations_endpt = 'https://api.gdc.cancer.gov/annotations' + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ant_id_list = [] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+buckets = response.json()['data']['aggregations']['program.name']['buckets'] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+case_id_list = [] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+cases = response.json()['data']['hits'] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+cases_endpt = 'https://api.gdc.cancer.gov/cases' + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+download_all_cases = False + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+download_all_projects = False + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+fields = ['annotation_id'] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+file_id_list = [] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+filters = {'op': 'in', 'content': {'field': entry[0:-1] + '_id', 'value': id_dict[entry]}} + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+id_dict = {'projects': proj_id_list, 'cases': case_id_list, 'files': file_id_list, 'annotations': ant_id_list} + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+number_of_cases = 2 + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+number_of_files = 2 + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+number_of_projects = 2 + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+params = {'fields': fields, 'filters': json.dumps(filters)} + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+proj_id_list = [] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+projects_endpt = 'https://api.gdc.cancer.gov/projects' + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+projects_list = response.json()['data']['hits'] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+response = requests.get(annotations_endpt, params=params) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+size = size_max + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+size_max = buckets[j]['doc_count'] + + + module-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/fairtracks/functions/index.html b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/functions/index.html new file mode 100644 index 00000000..3d055528 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/functions/index.html @@ -0,0 +1,2554 @@ + + + + + + + + + + + + + + + + + + + + + + functions - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

functions

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ENCODE_BASE_URL = 'https://www.encodeproject.org/' + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ENCODE_HEADERS = {'accept': 'application/json'} + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+GDC_BASE_URL = 'https://api.gdc.cancer.gov/' + + + module-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+encode_api(endpoint='experiments', id=None, limit=None, format='json', frame='object') + +

+ + +
+ +
+ Source code in src/omnipy/modules/fairtracks/functions.py +
 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
def encode_api(endpoint='experiments', id=None, limit=None, format='json', frame='object'):
+    api_url = ENCODE_BASE_URL + endpoint + '/' + (id if id else '@@listing') + '?' + '&'.join(
+        (['limit=' + limit] if limit else []) + (['format=' + format] if format else [])
+        + (['frame=' + frame] if frame else []))
+    print(api_url)
+    response = requests.get(api_url, headers=ENCODE_HEADERS)
+    if response.status_code == 200:
+        results = response.json()
+        if results['notification'] == 'Success':
+            graph = results['@graph']
+            return graph
+    else:
+        print('No result found')
+
+
+
+ +
+ +
+ + + +

+gdc_api(object_type='projects', starting_point=None, size=None) + +

+ + +
+ +
+ Source code in src/omnipy/modules/fairtracks/functions.py +
25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
def gdc_api(object_type='projects', starting_point=None, size=None):
+    api_url = GDC_BASE_URL + object_type + '/' + '?' + \
+              '&'.join(
+                  (['from=' + starting_point] if starting_point else [])
+                  + (['size=' + size] if size else [])
+                  + (['expand=' + 'project'] if object_type == 'cases' else [])
+              )
+    print(api_url)
+    response = requests.get(api_url)
+    if response.status_code != 200:
+        print('No result found')
+        return None
+
+    results = response.json()
+
+    if len(results['warnings']) > 0:
+        print('The following warnings have been encountered:')
+        print(results['warnings'])
+        return None
+
+    hits = (results['data']['hits'])
+    return hits
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/fairtracks/get_from_filter/index.html b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/get_from_filter/index.html new file mode 100644 index 00000000..306b6051 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/get_from_filter/index.html @@ -0,0 +1,2517 @@ + + + + + + + + + + + + + + + + + + + + + + get_from_filter - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

get_from_filter

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+endpt = 'https://api.gdc.cancer.gov/' + endpt_str + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+endpt_map = endpt + '/_mapping' + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+fields = ','.join(fields) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+filters = json.load(infile) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+params = {'filters': json.dumps(filters)} + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+response = requests.get(endpt, params=params) + + + module-attribute + + +

+ + +
+
+ +
+ + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/fairtracks/index.html b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/index.html new file mode 100644 index 00000000..fad4b045 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/index.html @@ -0,0 +1,2282 @@ + + + + + + + + + + + + + + + + + + + + + + fairtracks - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

fairtracks

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/fairtracks/tasks/index.html b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/tasks/index.html new file mode 100644 index 00000000..ad1ec064 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/fairtracks/tasks/index.html @@ -0,0 +1,2376 @@ + + + + + + + + + + + + + + + + + + + + + + tasks - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

tasks

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+import_dataset_from_encode(endpoints, max_data_item_count) + +

+ + +
+ +
+ Source code in src/omnipy/modules/fairtracks/tasks.py +
12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
@mypy_fix_task_template
+@TaskTemplate()
+def import_dataset_from_encode(endpoints: Iterable[constr(min_length=1)],
+                               max_data_item_count: PositiveInt) -> JsonDataset:
+    dataset = JsonDataset()
+    for endpoint in endpoints:
+        dataset[endpoint] = encode_api(
+            endpoint,
+            limit=str(max_data_item_count),
+            format='json',
+        )
+    return dataset
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/general/index.html b/docs/mkdocs_site/reference/omnipy/modules/general/index.html new file mode 100644 index 00000000..5e208cd5 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/general/index.html @@ -0,0 +1,2282 @@ + + + + + + + + + + + + + + + + + + + + + + general - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

general

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/general/models/index.html b/docs/mkdocs_site/reference/omnipy/modules/general/models/index.html new file mode 100644 index 00000000..8b2ce0f1 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/general/models/index.html @@ -0,0 +1,2380 @@ + + + + + + + + + + + + + + + + + + + + + + models - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

models

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ NotIteratorExceptStrings + + +

+ + +
+

+ Bases: Model[object]

+ + + +
+ Source code in src/omnipy/modules/general/models.py +
6
+7
+8
class NotIteratorExceptStrings(Model[object]):
+    def _parse_data(cls, data: object) -> object:
+        assert isinstance(data, str) or not isinstance(data, Iterable)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/general/tasks/index.html b/docs/mkdocs_site/reference/omnipy/modules/general/tasks/index.html new file mode 100644 index 00000000..cac0bc9c --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/general/tasks/index.html @@ -0,0 +1,2531 @@ + + + + + + + + + + + + + + + + + + + + + + tasks - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

tasks

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ModelT = TypeVar('ModelT', bound=Model) + + + module-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+cast_dataset(dataset, cast_model) + +

+ + +
+ +
+ Source code in src/omnipy/modules/general/tasks.py +
12
+13
+14
+15
+16
+17
+18
@mypy_fix_task_template
+@TaskTemplate()
+def cast_dataset(dataset: Dataset, cast_model: Callable[[], ModelT]) -> ModelT:
+    out_dataset: Dataset[ModelT] = Dataset[cast_model]()
+    for name, item in dataset.items():
+        out_dataset[name] = cast(cast_model, item.to_data())
+    return out_dataset
+
+
+
+ +
+ +
+ + + +

+import_directory(directory, exclude_prefixes=('.', '_'), include_suffixes=(), model=Model[str]) + +

+ + +
+ +
+ Source code in src/omnipy/modules/general/tasks.py +
39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
@mypy_fix_task_template
+@TaskTemplate()
+def import_directory(directory: str,
+                     exclude_prefixes: Tuple[str, ...] = ('.', '_'),
+                     include_suffixes: Tuple[str, ...] = (),
+                     model: Type[Model] = Model[str]) -> Dataset[Model]:
+    dataset = Dataset[model]()
+    for import_filename in os.listdir(directory):
+        if not exclude_prefixes or \
+                not any(import_filename.startswith(prefix) for prefix in exclude_prefixes):
+            if not include_suffixes or \
+                    any(import_filename.endswith(suffix) for suffix in include_suffixes):
+                with open(os.path.join(directory, import_filename)) as open_file:
+                    dataset_name = '_'.join(import_filename.split('.')[:-1])
+                    print(f"{import_filename} -> Dataset['{dataset_name}']")
+                    dataset[dataset_name] = open_file.read()
+    return dataset
+
+
+
+ +
+ +
+ + + +

+split_dataset(dataset, datafile_names_for_b) + +

+ + +
+ +
+ Source code in src/omnipy/modules/general/tasks.py +
21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
@mypy_fix_task_template
+@TaskTemplate()
+def split_dataset(
+        dataset: Dataset[Model[object]],
+        datafile_names_for_b: List[str]) -> Tuple[Dataset[Model[object]], Dataset[Model[object]]]:
+    model_cls = dataset.get_model_class()
+    datafile_names_for_a = set(dataset.keys()) - set(datafile_names_for_b)
+    dataset_a = Dataset[model_cls](  # type: ignore
+        {
+            name: dataset[name] for name in dataset.keys() if name in datafile_names_for_a
+        })
+    dataset_b = Dataset[model_cls](  # type: ignore
+        {
+            name: dataset[name] for name in dataset.keys() if name in datafile_names_for_b
+        })
+    return dataset_a, dataset_b
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/index.html b/docs/mkdocs_site/reference/omnipy/modules/index.html new file mode 100644 index 00000000..16bb483b --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/index.html @@ -0,0 +1,2280 @@ + + + + + + + + + + + + + + + + + + + + + + modules - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

modules

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/json/datasets/index.html b/docs/mkdocs_site/reference/omnipy/modules/json/datasets/index.html new file mode 100644 index 00000000..211ae796 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/json/datasets/index.html @@ -0,0 +1,2974 @@ + + + + + + + + + + + + + + + + + + + + + + datasets - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

datasets

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+JsonCustomDataset: TypeAlias = JsonBaseDataset + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfAnyDataset: TypeAlias = JsonBaseDataset[JsonDictOfAnyModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfDictsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonDictOfDictsOfAnyModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfDictsOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonDictOfDictsOfScalarsModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonDictOfListsOfAnyModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfDictsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonDictOfListsOfDictsOfAnyModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonDictOfListsOfScalarsModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonDictOfScalarsModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfAnyDataset: TypeAlias = JsonBaseDataset[JsonListOfAnyModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfDictsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonListOfDictsOfAnyModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfDictsOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonListOfDictsOfScalarsModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfListsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonListOfListsOfAnyModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfListsOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonListOfListsOfScalarsModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfNestedDictsDataset: TypeAlias = JsonBaseDataset[JsonListOfNestedDictsModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfScalarsDatabase: TypeAlias = JsonBaseDataset[JsonListOfScalarsModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonModelT = TypeVar('JsonModelT', bound=Union[JsonModel, JsonListModel, JsonDictModel]) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonNestedDictsDataset: TypeAlias = JsonBaseDataset[JsonNestedDictsModel] + + + module-attribute + + +

+ + +
+
+ +
+ + +
+ + + +

+ JsonBaseDataset + + +

+ + +
+

+ Bases: Dataset[JsonModelT], Generic[JsonModelT]

+ + + + + +
+ Source code in src/omnipy/modules/json/datasets.py +
33
+34
+35
class JsonBaseDataset(Dataset[JsonModelT], Generic[JsonModelT]):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ JsonDataset + + +

+ + +
+

+ Bases: JsonBaseDataset[JsonModel]

+ + + + + +
+ Source code in src/omnipy/modules/json/datasets.py +
41
+42
+43
class JsonDataset(JsonBaseDataset[JsonModel]):
+    """"""
+    ...
+
+
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/json/flows/index.html b/docs/mkdocs_site/reference/omnipy/modules/json/flows/index.html new file mode 100644 index 00000000..276a640b --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/json/flows/index.html @@ -0,0 +1,2390 @@ + + + + + + + + + + + + + + + + + + + + + + flows - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

flows

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+flatten_nested_json(dataset, id_key, ref_key, default_key) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/flows.py +
 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
@mypy_fix_func_flow_template
+@FuncFlowTemplate(fixed_params=dict(id_key=ID_KEY, ref_key=REF_KEY, default_key=DEFAULT_KEY))
+def flatten_nested_json(
+    dataset: JsonListOfDictsOfAnyDataset,
+    id_key: str,
+    ref_key: str,
+    default_key: str,
+) -> JsonListOfDictsOfScalarsDataset:
+    all_data_files_of_scalar_records_ds = JsonListOfDictsOfScalarsDataset()
+    data_files_of_any_ds = dataset
+
+    while len(data_files_of_any_ds) > 0:
+        data_files_of_scalar_records_ds, data_files_of_any_ds = \
+            flatten_outer_level_of_all_data_files(
+                data_files_of_any_ds, id_key, ref_key, default_key)
+
+        all_data_files_of_scalar_records_ds |= data_files_of_scalar_records_ds
+
+    return all_data_files_of_scalar_records_ds
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/json/functions/index.html b/docs/mkdocs_site/reference/omnipy/modules/json/functions/index.html new file mode 100644 index 00000000..98b2628d --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/json/functions/index.html @@ -0,0 +1,2663 @@ + + + + + + + + + + + + + + + + + + + + + + functions - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

functions

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+add_references_to_parent_in_child_records(child, parent_title, ident, ref_key) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/functions.py +
82
+83
+84
+85
+86
+87
+88
+89
+90
+91
def add_references_to_parent_in_child_records(
+    child: JsonListOfDictsOfAny,
+    parent_title: str,
+    ident: str,
+    ref_key: str,
+):
+    ref_value = get_ref_value(parent_title, ident)
+    for new_nested_record in child:
+        ensure_item_first_in_nested_record(
+            new_nested_record, key=ref_key, value=ref_value, fail_if_present=True)
+
+
+
+ +
+ +
+ + + +

+ensure_item_first_in_nested_record(nested_record, key, value, fail_if_present=False) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/functions.py +
43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
def ensure_item_first_in_nested_record(
+    nested_record: JsonDictOfAny,
+    key: str,
+    value: str,
+    fail_if_present: bool = False,
+) -> str:
+    if key in nested_record:
+        assert not fail_if_present, f'Key "{key}" already present in dict'
+        del nested_record[key]
+
+    update_dict_from_front(nested_record, {key: value})
+
+    return value
+
+
+
+ +
+ +
+ + + +

+flatten_outer_level_of_nested_record(nested_record, record_id, data_file_title, id_key, ref_key, default_key) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/functions.py +
13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
def flatten_outer_level_of_nested_record(
+    nested_record: JsonDictOfAny,
+    record_id: str,
+    data_file_title: str,
+    id_key: str,
+    ref_key: str,
+    default_key: str,
+) -> Tuple[JsonDictOfScalars, JsonDictOfListsOfDictsOfAny]:
+
+    record_id = ensure_item_first_in_nested_record(nested_record, key=id_key, value=record_id)
+
+    new_data_files: JsonDictOfListsOfDictsOfAny = JsonDictOfListsOfDictsOfAny()
+    records_of_scalars: JsonDictOfScalars = JsonDictOfScalars()
+
+    for key, value in nested_record.items():
+        if any(isinstance(value, typ) for typ in (dict, list)):
+            new_data_file_title: str = f'{data_file_title}.{key}'
+            new_data_file: JsonListOfDictsOfAny = transform_into_list_of_dicts(
+                cast(Union[JsonListOfAny, JsonDictOfAny], value), default_key=default_key)
+
+            add_references_to_parent_in_child_records(
+                child=new_data_file, parent_title=data_file_title, ident=record_id, ref_key=ref_key)
+
+            new_data_files[new_data_file_title] = new_data_file
+        else:
+            records_of_scalars[key] = cast(JsonScalar, value)
+
+    return records_of_scalars, new_data_files
+
+
+
+ +
+ +
+ + + +

+get_ref_value(data_file_title, ident) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/functions.py +
94
+95
def get_ref_value(data_file_title: str, ident: str) -> str:
+    return f'{data_file_title}.{ident}'
+
+
+
+ +
+ +
+ + + +

+transform_into_list_of_dicts(value, default_key) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/functions.py +
65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
def transform_into_list_of_dicts(value: Union[JsonListOfAny, JsonDictOfAny],
+                                 default_key: str) -> JsonListOfDictsOfAny:
+    if isinstance(value, JsonDict):
+        return JsonListOfDictsOfAny([value])
+    else:
+        ret_value = JsonListOfDictsOfAny()
+
+        for list_val in value:
+            if isinstance(list_val, dict):
+                ret_value.append(list_val)
+            else:
+                new_nested_record = JsonDictOfAny({default_key: list_val})
+                ret_value.append(new_nested_record)
+
+        return ret_value
+
+
+
+ +
+ +
+ + + +

+update_dict_from_front(dict_a, dict_b) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/functions.py +
58
+59
+60
+61
+62
def update_dict_from_front(dict_a: Dict, dict_b: Dict) -> None:
+    dict_a_copy = copy(dict_a)
+    dict_a.clear()
+    dict_a.update(dict_b)
+    dict_a.update(dict_a_copy)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/json/index.html b/docs/mkdocs_site/reference/omnipy/modules/json/index.html new file mode 100644 index 00000000..a34aa384 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/json/index.html @@ -0,0 +1,2282 @@ + + + + + + + + + + + + + + + + + + + + + + json - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

json

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/json/models/index.html b/docs/mkdocs_site/reference/omnipy/modules/json/models/index.html new file mode 100644 index 00000000..c35c1b13 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/json/models/index.html @@ -0,0 +1,3134 @@ + + + + + + + + + + + + + + + + + + + + + + models - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

models

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+BaseT = TypeVar('BaseT', bound=Union[JsonScalar, 'JsonListModel', 'JsonDictModel', List, Dict]) + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfAnyModel: TypeAlias = JsonDictModel[JsonSubModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfDictsOfAnyModel: TypeAlias = JsonDictModel[JsonDictModel[JsonSubModel]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfDictsOfScalarsModel: TypeAlias = JsonDictModel[JsonDictModel[JsonScalar]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfAnyModel: TypeAlias = JsonDictModel[JsonListModel[JsonSubModel]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfDictsOfAnyModel: TypeAlias = JsonDictModel[JsonListOfDictsOfAnyModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfScalarsModel: TypeAlias = JsonDictModel[JsonListModel[JsonScalar]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfScalarsModel: TypeAlias = JsonDictModel[JsonScalar] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfAnyModel: TypeAlias = JsonListModel[JsonSubModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfDictsOfAnyModel: TypeAlias = JsonListModel[JsonDictModel[JsonSubModel]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfDictsOfScalarsModel: TypeAlias = JsonListModel[JsonDictModel[JsonScalar]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfListsOfAnyModel: TypeAlias = JsonListModel[JsonListModel[JsonSubModel]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfListsOfScalarsModel: TypeAlias = JsonListModel[JsonListModel[JsonScalar]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfNestedDictsModel: TypeAlias = JsonListModel[JsonNestedDictsModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfScalarsModel: TypeAlias = JsonListModel[JsonScalar] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonNestedDictsModel: TypeAlias = JsonDictModel[JsonNoListsSubModel] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonNoListsSubModel: TypeAlias = Union[JsonScalar, JsonDictModel['JsonNoListsSubModel']] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonSubModel: TypeAlias = Union[JsonScalar, JsonListModel['JsonSubModel'], JsonDictModel['JsonSubModel']] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonSubModelT = TypeVar('JsonSubModelT', bound=Union[JsonScalar, 'JsonListModel', 'JsonDictModel']) + + + module-attribute + + +

+ + +
+
+ +
+ + +
+ + + +

+ JsonCustomModel + + +

+ + +
+

+ Bases: _JsonBaseModel[JsonSubModelT], Generic[JsonSubModelT]

+ + + + + +
+ Source code in src/omnipy/modules/json/models.py +
52
+53
+54
class JsonCustomModel(_JsonBaseModel[JsonSubModelT], Generic[JsonSubModelT]):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ JsonDictModel + + +

+ + +
+

+ Bases: _JsonBaseModel[Dict[str, Optional[JsonSubModelT]]], Generic[JsonSubModelT]

+ + + + + +
+ Source code in src/omnipy/modules/json/models.py +
26
+27
+28
class JsonDictModel(_JsonBaseModel[Dict[str, Optional[JsonSubModelT]]], Generic[JsonSubModelT]):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ JsonListModel + + +

+ + +
+

+ Bases: _JsonBaseModel[List[Optional[JsonSubModelT]]], Generic[JsonSubModelT]

+ + + + + +
+ Source code in src/omnipy/modules/json/models.py +
20
+21
+22
class JsonListModel(_JsonBaseModel[List[Optional[JsonSubModelT]]], Generic[JsonSubModelT]):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ JsonModel + + +

+ + +
+

+ Bases: _JsonBaseModel[JsonSubModel]

+ + + + + +
+ Source code in src/omnipy/modules/json/models.py +
44
+45
+46
class JsonModel(_JsonBaseModel[JsonSubModel]):
+    """"""
+    ...
+
+
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/json/serializers/index.html b/docs/mkdocs_site/reference/omnipy/modules/json/serializers/index.html new file mode 100644 index 00000000..345760b3 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/json/serializers/index.html @@ -0,0 +1,2717 @@ + + + + + + + + + + + + + + + + + + + + + + serializers - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

serializers

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ JsonDatasetToTarFileSerializer + + +

+ + +
+

+ Bases: TarFileSerializer

+ + + + + +
+ Source code in src/omnipy/modules/json/serializers.py +
10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
class JsonDatasetToTarFileSerializer(TarFileSerializer):
+    """"""
+    @classmethod
+    def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:
+        return isinstance(dataset, JsonBaseDataset)
+
+    @classmethod
+    def get_dataset_cls_for_new(cls) -> Type[Dataset]:
+        return JsonDataset
+
+    @classmethod
+    def get_output_file_suffix(cls) -> str:
+        return 'json'
+
+    @classmethod
+    def serialize(cls, json_dataset: JsonDataset) -> Union[bytes, memoryview]:
+        def json_encode_func(json_data: JsonModel) -> bytes:
+            return json_data.json(indent=2).encode('utf8')
+
+        return cls.create_tarfile_from_dataset(json_dataset, data_encode_func=json_encode_func)
+
+    @classmethod
+    def deserialize(cls, tarfile_bytes: bytes) -> JsonDataset:
+        json_dataset = JsonDataset()
+
+        def json_decode_func(file_stream: IO[bytes]) -> str:
+            return file_stream.read().decode('utf8')
+
+        def json_dictify_object(obj_type: str, obj_val: str) -> Dict[str, str]:
+            return {f'{obj_type}': f'{obj_val}'}
+
+        cls.create_dataset_from_tarfile(
+            json_dataset,
+            tarfile_bytes,
+            data_decode_func=json_decode_func,
+            dictify_object_func=json_dictify_object,
+            import_method='from_json')
+
+        return json_dataset
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+deserialize(tarfile_bytes) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/serializers.py +
31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
@classmethod
+def deserialize(cls, tarfile_bytes: bytes) -> JsonDataset:
+    json_dataset = JsonDataset()
+
+    def json_decode_func(file_stream: IO[bytes]) -> str:
+        return file_stream.read().decode('utf8')
+
+    def json_dictify_object(obj_type: str, obj_val: str) -> Dict[str, str]:
+        return {f'{obj_type}': f'{obj_val}'}
+
+    cls.create_dataset_from_tarfile(
+        json_dataset,
+        tarfile_bytes,
+        data_decode_func=json_decode_func,
+        dictify_object_func=json_dictify_object,
+        import_method='from_json')
+
+    return json_dataset
+
+
+
+ +
+ +
+ + + +

+get_dataset_cls_for_new() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/serializers.py +
16
+17
+18
@classmethod
+def get_dataset_cls_for_new(cls) -> Type[Dataset]:
+    return JsonDataset
+
+
+
+ +
+ +
+ + + +

+get_output_file_suffix() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/serializers.py +
20
+21
+22
@classmethod
+def get_output_file_suffix(cls) -> str:
+    return 'json'
+
+
+
+ +
+ +
+ + + +

+is_dataset_directly_supported(dataset) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/serializers.py +
12
+13
+14
@classmethod
+def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:
+    return isinstance(dataset, JsonBaseDataset)
+
+
+
+ +
+ +
+ + + +

+serialize(json_dataset) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/serializers.py +
24
+25
+26
+27
+28
+29
@classmethod
+def serialize(cls, json_dataset: JsonDataset) -> Union[bytes, memoryview]:
+    def json_encode_func(json_data: JsonModel) -> bytes:
+        return json_data.json(indent=2).encode('utf8')
+
+    return cls.create_tarfile_from_dataset(json_dataset, data_encode_func=json_encode_func)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/json/tasks/index.html b/docs/mkdocs_site/reference/omnipy/modules/json/tasks/index.html new file mode 100644 index 00000000..b81e5af3 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/json/tasks/index.html @@ -0,0 +1,2655 @@ + + + + + + + + + + + + + + + + + + + + + + tasks - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

tasks

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+DEFAULT_KEY = '__root__' + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+ID_KEY = '_omnipy_id' + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+REF_KEY = '_omnipy_ref' + + + module-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+convert_dataset_string_to_json(dataset) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/tasks.py +
24
+25
+26
+27
+28
+29
@mypy_fix_task_template
+@TaskTemplate()
+def convert_dataset_string_to_json(dataset: Dataset[Model[str]]) -> JsonDataset:
+    json_dataset = JsonDataset()
+    json_dataset.from_json(dataset.to_data())
+    return json_dataset
+
+
+
+ +
+ +
+ + + +

+flatten_outer_level_of_all_data_files(dataset, id_key, ref_key, default_key) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/tasks.py +
56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
@mypy_fix_task_template
+@TaskTemplate()
+def flatten_outer_level_of_all_data_files(
+        dataset: JsonListOfDictsOfAnyDataset, id_key: str, ref_key: str,
+        default_key: str) -> Tuple[JsonListOfDictsOfScalarsDataset, JsonListOfDictsOfAnyDataset]:
+
+    data_files_of_scalar_records: defaultdict[str, JsonListOfDictsOfScalars] = \
+        defaultdict(JsonListOfDictsOfScalars)
+    data_files_of_any: defaultdict[str, JsonListOfDictsOfAny] = defaultdict(JsonListOfDictsOfAny)
+
+    dataset_as_data: JsonDictOfListsOfDictsOfAny = \
+        cast(JsonDictOfListsOfDictsOfAny, dataset.to_data())
+
+    for data_file_title, item in dataset_as_data.items():
+        data_file: JsonListOfDictsOfAny = item
+
+        if len(data_file) == 0:
+            data_files_of_scalar_records[data_file_title] = JsonListOfDictsOfScalars()
+
+        for record_id, nested_record in enumerate(data_file):
+            record_of_scalars: JsonDictOfScalars
+            new_data_files_of_any: JsonDictOfListsOfDictsOfAny
+            record_of_scalars, new_data_files_of_any = flatten_outer_level_of_nested_record(
+                nested_record,
+                str(record_id),
+                data_file_title,
+                id_key,
+                ref_key,
+                default_key,
+            )
+
+            new_data_file_title: str
+            new_data_file_of_any: JsonListOfDictsOfAny
+            for new_data_file_title, new_data_file_of_any in new_data_files_of_any.items():
+                data_files_of_any[new_data_file_title] += new_data_file_of_any
+            data_files_of_scalar_records[data_file_title].append(record_of_scalars)
+
+    data_files_of_scalar_records_ds = JsonListOfDictsOfScalarsDataset(data_files_of_scalar_records)
+    data_files_of_any_ds = JsonListOfDictsOfAnyDataset(data_files_of_any)
+
+    return data_files_of_scalar_records_ds, data_files_of_any_ds
+
+
+
+ +
+ +
+ + + +

+transpose_dataset_of_dicts_to_lists(dataset, id_key=ID_KEY) + +

+ + +
+ +
+ Source code in src/omnipy/modules/json/tasks.py +
32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
@mypy_fix_task_template
+@TaskTemplate()
+def transpose_dataset_of_dicts_to_lists(dataset: JsonDictOfAnyDataset,
+                                        id_key: str = ID_KEY) -> JsonListOfDictsOfAnyDataset:
+    output_dataset = JsonListOfDictsOfAnyDataset()
+    output_data = defaultdict(list)
+
+    for name, item in dataset.items():
+        for key, val in item.to_data().items():
+            if not isinstance(val, list):
+                val = [val]
+
+            for item_index, val_item in enumerate(val):
+                if isinstance(val_item, dict):
+                    data = {id_key: f'{name}_{item_index}'}
+                    assert id_key not in val_item
+                    data |= val_item
+                else:
+                    data = val_item
+                output_data[key].append(data)
+    output_dataset |= output_data.items()
+    return output_dataset
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/json/types/index.html b/docs/mkdocs_site/reference/omnipy/modules/json/types/index.html new file mode 100644 index 00000000..3a4d43b8 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/json/types/index.html @@ -0,0 +1,3040 @@ + + + + + + + + + + + + + + + + + + + + + + types - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

types

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+Json: TypeAlias = Union[JsonScalar, JsonList['Json'], JsonDict['Json']] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfAny: TypeAlias = JsonDict[Json] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfDictsOfAny: TypeAlias = JsonDict[JsonDict[Json]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfDictsOfScalars: TypeAlias = JsonDict[JsonDict[JsonScalar]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfAny: TypeAlias = JsonDict[JsonList[Json]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfDictsOfAny: TypeAlias = JsonDict[JsonListOfDictsOfAny] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfListsOfScalars: TypeAlias = JsonDict[JsonList[JsonScalar]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonDictOfScalars: TypeAlias = JsonDict[JsonScalar] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfAny: TypeAlias = JsonList[Json] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfDictsOfAny: TypeAlias = JsonList[JsonDict[Json]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfDictsOfScalars: TypeAlias = JsonList[JsonDict[JsonScalar]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfListsOfAny: TypeAlias = JsonList[JsonList[Json]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfListsOfScalars: TypeAlias = JsonList[JsonList[JsonScalar]] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfNestedDicts: TypeAlias = JsonList[JsonNestedDicts] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonListOfScalars: TypeAlias = JsonList[JsonScalar] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonNestedDicts: TypeAlias = JsonDict[JsonNoLists] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonNoLists: TypeAlias = Union[JsonScalar, JsonDict['JsonNoLists']] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonScalar: TypeAlias = Union[None, int, float, str, bool] + + + module-attribute + + +

+ + +
+
+ +
+ +
+ + + +

+JsonT = TypeVar('JsonT', bound=Union[JsonScalar, 'JsonList', 'JsonDict']) + + + module-attribute + + +

+ + +
+
+ +
+ + +
+ + + +

+ JsonDict + + +

+ + +
+

+ Bases: Dict[str, JsonT], Generic[JsonT]

+ + + + + +
+ Source code in src/omnipy/modules/json/types.py +
15
+16
+17
class JsonDict(Dict[str, JsonT], Generic[JsonT]):
+    """"""
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ JsonList + + +

+ + +
+

+ Bases: List[JsonT], Generic[JsonT]

+ + + + + +
+ Source code in src/omnipy/modules/json/types.py +
10
+11
+12
class JsonList(List[JsonT], Generic[JsonT]):
+    """"""
+    ...
+
+
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/pandas/index.html b/docs/mkdocs_site/reference/omnipy/modules/pandas/index.html new file mode 100644 index 00000000..1506af83 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/pandas/index.html @@ -0,0 +1,2282 @@ + + + + + + + + + + + + + + + + + + + + + + pandas - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

pandas

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/pandas/models/index.html b/docs/mkdocs_site/reference/omnipy/modules/pandas/models/index.html new file mode 100644 index 00000000..8a24a067 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/pandas/models/index.html @@ -0,0 +1,2661 @@ + + + + + + + + + + + + + + + + + + + + + + models - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

models

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ ListOfPandasDatasetsWithSameNumberOfFiles + + +

+ + +
+

+ Bases: Model[List[PandasDataset]]

+ + + +
+ Source code in src/omnipy/modules/pandas/models.py +
42
+43
+44
+45
+46
class ListOfPandasDatasetsWithSameNumberOfFiles(Model[List[PandasDataset]]):
+    @classmethod
+    def _parse_data(cls, dataset_list: List[PandasDataset]) -> Any:
+        assert len(dataset_list) >= 2
+        assert all(len(dataset) for dataset in dataset_list)
+
+
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ PandasDataset + + +

+ + +
+

+ Bases: Dataset[PandasModel]

+ + + +
+ Source code in src/omnipy/modules/pandas/models.py +
38
+39
class PandasDataset(Dataset[PandasModel]):
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ PandasModel + + +

+ + +
+

+ Bases: Model[pd.DataFrame]

+ + + +
+ Source code in src/omnipy/modules/pandas/models.py +
10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
class PandasModel(Model[pd.DataFrame]):
+    @classmethod
+    def _parse_data(cls, data: pd.DataFrame) -> pd.DataFrame:
+        cls._data_column_names_are_strings(data)
+        cls._data_not_empty_object(data)
+        return data
+
+    @staticmethod
+    def _data_column_names_are_strings(data: pd.DataFrame) -> None:
+        for column in data.columns:
+            assert isinstance(column, str)
+
+    @staticmethod
+    def _data_not_empty_object(data: pd.DataFrame) -> None:
+        assert not any(data.isna().all(axis=1))
+
+    def dict(self, *args, **kwargs) -> Dict[Any, Any]:
+        df = super().dict(*args, **kwargs)[ROOT_KEY]
+        df = df.replace({pd.NA: None})
+        return df.to_dict(orient='records')  # noqa
+
+    def from_data(self, value: Iterable[Any]) -> None:
+        self.contents = pd.DataFrame(value).convert_dtypes()
+
+    def from_json(self, value: str) -> None:
+        self.contents = pd.read_json(value).convert_dtypes()
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+dict(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/models.py +
26
+27
+28
+29
def dict(self, *args, **kwargs) -> Dict[Any, Any]:
+    df = super().dict(*args, **kwargs)[ROOT_KEY]
+    df = df.replace({pd.NA: None})
+    return df.to_dict(orient='records')  # noqa
+
+
+
+ +
+ +
+ + + +

+from_data(value) + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/models.py +
31
+32
def from_data(self, value: Iterable[Any]) -> None:
+    self.contents = pd.DataFrame(value).convert_dtypes()
+
+
+
+ +
+ +
+ + + +

+from_json(value) + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/models.py +
34
+35
def from_json(self, value: str) -> None:
+    self.contents = pd.read_json(value).convert_dtypes()
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/pandas/serializers/index.html b/docs/mkdocs_site/reference/omnipy/modules/pandas/serializers/index.html new file mode 100644 index 00000000..e67e0886 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/pandas/serializers/index.html @@ -0,0 +1,2733 @@ + + + + + + + + + + + + + + + + + + + + + + serializers - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

serializers

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ PandasDatasetToTarFileSerializer + + +

+ + +
+

+ Bases: TarFileSerializer

+ + + + + +
+ Source code in src/omnipy/modules/pandas/serializers.py +
11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
class PandasDatasetToTarFileSerializer(TarFileSerializer):
+    """"""
+    @classmethod
+    def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:
+        return isinstance(dataset, PandasDataset)
+
+    @classmethod
+    def get_dataset_cls_for_new(cls) -> Type[Dataset]:
+        return PandasDataset
+
+    @classmethod
+    def get_output_file_suffix(cls) -> str:
+        return 'csv'
+
+    @classmethod
+    def serialize(cls, pandas_dataset: PandasDataset) -> Union[bytes, memoryview]:
+        assert isinstance(pandas_dataset, PandasDataset)
+
+        def pandas_encode_func(pandas_data: pd.DataFrame) -> memoryview:
+            csv_bytes = BytesIO()
+            pandas_data.to_csv(csv_bytes, encoding='utf8', mode='b', index=False)
+            return csv_bytes.getbuffer()
+
+        return cls.create_tarfile_from_dataset(pandas_dataset, data_encode_func=pandas_encode_func)
+
+    @classmethod
+    def deserialize(cls, tarfile_bytes: bytes) -> PandasDataset:
+        pandas_dataset = PandasDataset()
+
+        def csv_decode_func(file_stream: IO[bytes]) -> pd.DataFrame:
+            return pd.read_csv(file_stream, encoding='utf8')
+
+        def python_dictify_object(obj_type: str, obj_val: Any) -> Dict:
+            return {obj_type: obj_val}
+
+        cls.create_dataset_from_tarfile(
+            pandas_dataset,
+            tarfile_bytes,
+            data_decode_func=csv_decode_func,
+            dictify_object_func=python_dictify_object,
+            import_method='from_data')  # noqa
+
+        return pandas_dataset
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+deserialize(tarfile_bytes) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/serializers.py +
36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
@classmethod
+def deserialize(cls, tarfile_bytes: bytes) -> PandasDataset:
+    pandas_dataset = PandasDataset()
+
+    def csv_decode_func(file_stream: IO[bytes]) -> pd.DataFrame:
+        return pd.read_csv(file_stream, encoding='utf8')
+
+    def python_dictify_object(obj_type: str, obj_val: Any) -> Dict:
+        return {obj_type: obj_val}
+
+    cls.create_dataset_from_tarfile(
+        pandas_dataset,
+        tarfile_bytes,
+        data_decode_func=csv_decode_func,
+        dictify_object_func=python_dictify_object,
+        import_method='from_data')  # noqa
+
+    return pandas_dataset
+
+
+
+ +
+ +
+ + + +

+get_dataset_cls_for_new() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/serializers.py +
17
+18
+19
@classmethod
+def get_dataset_cls_for_new(cls) -> Type[Dataset]:
+    return PandasDataset
+
+
+
+ +
+ +
+ + + +

+get_output_file_suffix() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/serializers.py +
21
+22
+23
@classmethod
+def get_output_file_suffix(cls) -> str:
+    return 'csv'
+
+
+
+ +
+ +
+ + + +

+is_dataset_directly_supported(dataset) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/serializers.py +
13
+14
+15
@classmethod
+def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:
+    return isinstance(dataset, PandasDataset)
+
+
+
+ +
+ +
+ + + +

+serialize(pandas_dataset) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/serializers.py +
25
+26
+27
+28
+29
+30
+31
+32
+33
+34
@classmethod
+def serialize(cls, pandas_dataset: PandasDataset) -> Union[bytes, memoryview]:
+    assert isinstance(pandas_dataset, PandasDataset)
+
+    def pandas_encode_func(pandas_data: pd.DataFrame) -> memoryview:
+        csv_bytes = BytesIO()
+        pandas_data.to_csv(csv_bytes, encoding='utf8', mode='b', index=False)
+        return csv_bytes.getbuffer()
+
+    return cls.create_tarfile_from_dataset(pandas_dataset, data_encode_func=pandas_encode_func)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/pandas/tasks/index.html b/docs/mkdocs_site/reference/omnipy/modules/pandas/tasks/index.html new file mode 100644 index 00000000..f67a346d --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/pandas/tasks/index.html @@ -0,0 +1,2626 @@ + + + + + + + + + + + + + + + + + + + + + + tasks - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

tasks

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+concat_dataframes_across_datasets(dataset_list, vertical=True) + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/tasks.py +
79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
@mypy_fix_task_template
+@TaskTemplate()
+def concat_dataframes_across_datasets(dataset_list: ListOfPandasDatasetsWithSameNumberOfFiles,
+                                      vertical=True) -> PandasDataset:
+    # We know from the data type that there are at least two datasets and that there is an equal
+    # amount of files/DataFrames in each dataset. This simplifies implementation.
+
+    out_dataset = PandasDataset()
+    out_datafile_names = tuple(dataset_list[0].keys())
+    for df_index in range(len(out_datafile_names)):
+        df = pd.concat([tuple(dataset.values())[df_index] for dataset in dataset_list],
+                       axis=0 if vertical else 1)
+        out_dataset[out_datafile_names[df_index]] = df
+    return out_dataset
+
+
+
+ +
+ +
+ + + +

+convert_dataset_csv_to_pandas(dataset, delimiter=',', first_row_as_col_names=True, col_names=None, ignore_comments=True, comments_char='#') + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/tasks.py +
23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
@mypy_fix_task_template
+@TaskTemplate()
+def convert_dataset_csv_to_pandas(dataset: Dataset[Model[bytes]],
+                                  delimiter: str = ',',
+                                  first_row_as_col_names=True,
+                                  col_names: Optional[List[str]] = None,
+                                  ignore_comments: bool = True,
+                                  comments_char: str = '#') -> PandasDataset:
+    out_dataset = PandasDataset()
+    for key, item in dataset.items():
+        df = pd.read_csv(
+            StringIO(item),
+            sep=delimiter,
+            header='infer' if first_row_as_col_names else 0,
+            names=col_names,
+            comment=comments_char if ignore_comments else None,
+            encoding='utf8',
+        )
+        out_dataset[key] = df
+    return out_dataset
+
+
+
+ +
+ +
+ + + +

+convert_dataset_list_of_dicts_to_pandas(dataset) + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/tasks.py +
14
+15
+16
+17
+18
+19
+20
@mypy_fix_task_template
+@TaskTemplate()
+def convert_dataset_list_of_dicts_to_pandas(
+        dataset: Dataset[Model[List[Dict[str, NotIteratorExceptStrings]]]]) -> PandasDataset:
+    pandas_dataset = PandasDataset()
+    pandas_dataset.from_data(dataset.to_data())
+    return pandas_dataset
+
+
+
+ +
+ +
+ + + +

+convert_dataset_pandas_to_csv(dataset, delimiter=',', first_row_as_col_names=True, col_names=None) + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/tasks.py +
45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
@mypy_fix_task_template
+@TaskTemplate()
+def convert_dataset_pandas_to_csv(
+    dataset: PandasDataset,
+    delimiter: str = ',',
+    first_row_as_col_names=True,
+    col_names: Optional[List[str]] = None,
+) -> Dataset[Model[str]]:
+    out_dataset = Dataset[Model[str]]()
+    for key, df in dataset.items():
+        csv_stream = StringIO()
+        df.to_csv(
+            csv_stream,
+            sep=delimiter,
+            header=col_names if col_names else True if first_row_as_col_names else False,
+            encoding='utf8',
+            index=False)
+        out_dataset[key] = csv_stream.getvalue()
+    return out_dataset
+
+
+
+ +
+ +
+ + + +

+extract_columns_as_files(dataset, col_names) + +

+ + +
+ +
+ Source code in src/omnipy/modules/pandas/tasks.py +
66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
@mypy_fix_task_template
+@TaskTemplate()
+def extract_columns_as_files(dataset: PandasDataset, col_names: List[str]) -> PandasDataset:
+    out_dataset = PandasDataset()
+    for key, item in dataset.items():
+        df = dataset[key]
+        out_dataset[key] = df.loc[:, ~df.columns.isin(col_names)]
+
+        for col_name in col_names:
+            out_dataset[f'{key}.{col_name}'] = pd.DataFrame(df[col_name])
+    return out_dataset
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/prefect/engine/index.html b/docs/mkdocs_site/reference/omnipy/modules/prefect/engine/index.html new file mode 100644 index 00000000..a5ab55ca --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/prefect/engine/index.html @@ -0,0 +1,2284 @@ + + + + + + + + + + + + + + + + + + + + + + engine - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

engine

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/prefect/engine/prefect/index.html b/docs/mkdocs_site/reference/omnipy/modules/prefect/engine/prefect/index.html new file mode 100644 index 00000000..a46dca4f --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/prefect/engine/prefect/index.html @@ -0,0 +1,2729 @@ + + + + + + + + + + + + + + + + + + + + + + prefect - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

prefect

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ PrefectEngine + + +

+ + +
+

+ Bases: TaskRunnerEngine, LinearFlowRunnerEngine, DagFlowRunnerEngine, FuncFlowRunnerEngine

+ + +

Job runner engine for Prefect

+ + +
+ Source code in src/omnipy/modules/prefect/engine/prefect.py +
 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
class PrefectEngine(TaskRunnerEngine,
+                    LinearFlowRunnerEngine,
+                    DagFlowRunnerEngine,
+                    FuncFlowRunnerEngine):
+    """Job runner engine for Prefect"""
+    def _init_engine(self) -> None:
+        ...
+
+    def _update_from_config(self) -> None:
+        ...
+
+    @classmethod
+    def get_config_cls(cls) -> Type[IsPrefectEngineConfig]:
+        return PrefectEngineConfig
+
+    # TaskRunnerEngine
+
+    def _init_task(self, task: IsTask, call_func: Callable) -> PrefectTask:
+        assert isinstance(self._config, PrefectEngineConfig)
+        task_kwargs = dict(
+            name=task.name,
+            cache_key_fn=task_input_hash if self._config.use_cached_results else None,
+            cache_expiration=timedelta(days=1))
+
+        if task.has_coroutine_func():
+
+            @prefect_task(**task_kwargs)
+            async def run_task(*inner_args, **inner_kwargs):
+                return await call_func(*inner_args, **inner_kwargs)
+        else:
+
+            @prefect_task(**task_kwargs)
+            def run_task(*inner_args, **inner_kwargs):
+                return call_func(*inner_args, **inner_kwargs)
+
+        return run_task
+
+    def _run_task(self, state: PrefectTask, task: IsTask, call_func: Callable, *args,
+                  **kwargs) -> Any:
+
+        _prefect_task = state
+
+        if task.in_flow_context:
+            return _prefect_task(*args, **kwargs)
+        else:
+            flow_kwargs = dict(name=task.name)
+
+            if asyncio.iscoroutinefunction(_prefect_task):
+
+                @prefect_flow(**flow_kwargs)
+                async def task_flow(*inner_args, **inner_kwargs):
+                    return await resolve(_prefect_task(*inner_args, **inner_kwargs))
+            else:
+
+                @prefect_flow(**flow_kwargs)
+                def task_flow(*inner_args, **inner_kwargs):
+                    return _prefect_task(*inner_args, **inner_kwargs)
+
+            return task_flow(*args, **kwargs)
+
+    # LinearFlowRunnerEngine
+    def _init_linear_flow(self, linear_flow: IsLinearFlow) -> Any:
+        assert isinstance(self._config, PrefectEngineConfig)
+        flow_kwargs = dict(name=linear_flow.name,)
+        call_func = self.default_linear_flow_run_decorator(linear_flow)
+
+        if linear_flow.has_coroutine_func():
+
+            @prefect_flow(**flow_kwargs)
+            async def run_linear_flow(*inner_args, **inner_kwargs):
+                with linear_flow.flow_context:
+                    return await resolve(call_func(*inner_args, **inner_kwargs))
+        else:
+
+            @prefect_flow(**flow_kwargs)
+            def run_linear_flow(*inner_args, **inner_kwargs):
+                with linear_flow.flow_context:
+                    return call_func(*inner_args, **inner_kwargs)
+
+        return run_linear_flow
+
+    def _run_linear_flow(self, state: Any, linear_flow: IsLinearFlow, *args, **kwargs) -> Any:
+
+        _prefect_flow = state
+
+        return _prefect_flow(*args, **kwargs)
+
+    # DagFlowRunnerEngine
+
+    def _init_dag_flow(self, dag_flow: IsDagFlow) -> Any:
+
+        assert isinstance(self._config, PrefectEngineConfig)
+        flow_kwargs = dict(name=dag_flow.name,)
+        call_func = self.default_dag_flow_run_decorator(dag_flow)
+
+        if dag_flow.has_coroutine_func():
+
+            @prefect_flow(**flow_kwargs)
+            async def run_dag_flow(*inner_args, **inner_kwargs):
+                with dag_flow.flow_context:
+                    return await resolve(call_func(*inner_args, **inner_kwargs))
+        else:
+
+            @prefect_flow(**flow_kwargs)
+            def run_dag_flow(*inner_args, **inner_kwargs):
+                with dag_flow.flow_context:
+                    return call_func(*inner_args, **inner_kwargs)
+
+        return run_dag_flow
+
+    def _run_dag_flow(self, state: PrefectFlow, flow: IsDagFlow, *args, **kwargs) -> Any:
+
+        _prefect_flow = state
+
+        return _prefect_flow(*args, **kwargs)
+
+    # FuncFlowRunnerEngine
+
+    def _init_func_flow(self, func_flow: IsFuncFlow, call_func: Callable) -> object:
+
+        assert isinstance(self._config, PrefectEngineConfig)
+        flow_kwargs = dict(name=func_flow.name,)
+
+        if func_flow.has_coroutine_func():
+
+            @prefect_flow(**flow_kwargs)
+            async def run_func_flow(*inner_args, **inner_kwargs):
+                with func_flow.flow_context:
+                    return await resolve(call_func(*inner_args, **inner_kwargs))
+        else:
+
+            @prefect_flow(**flow_kwargs)
+            def run_func_flow(*inner_args, **inner_kwargs):
+                with func_flow.flow_context:
+                    return call_func(*inner_args, **inner_kwargs)
+
+        return run_func_flow
+
+    def _run_func_flow(self,
+                       state: Any,
+                       func_flow: IsFuncFlow,
+                       call_func: Callable,
+                       *args,
+                       **kwargs) -> Any:
+
+        _prefect_flow = state
+
+        return _prefect_flow(*args, **kwargs)
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+get_config_cls() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/prefect/engine/prefect.py +
32
+33
+34
@classmethod
+def get_config_cls(cls) -> Type[IsPrefectEngineConfig]:
+    return PrefectEngineConfig
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/prefect/index.html b/docs/mkdocs_site/reference/omnipy/modules/prefect/index.html new file mode 100644 index 00000000..f30dab3c --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/prefect/index.html @@ -0,0 +1,2352 @@ + + + + + + + + + + + + + + + + + + + + + + prefect - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

prefect

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+set_prefect_config_path() + +

+ + +
+ +
+ Source code in src/omnipy/modules/prefect/__init__.py +
 7
+ 8
+ 9
+10
+11
def set_prefect_config_path():
+    prefect_module_dir = os.path.dirname(inspect.getabsfile(inspect.currentframe()))
+
+    os.environ['PREFECT_LOGGING_SETTINGS_PATH'] = \
+        f"{Path(prefect_module_dir).joinpath('settings', 'logging.yml')}"
+
+
+
+ +
+ +
+ + + +

+use_local_api_for_tests() + +

+ + +
+ +
+ Source code in src/omnipy/modules/prefect/__init__.py +
14
+15
+16
+17
def use_local_api_for_tests():
+    if 'pytest' in sys.modules:
+        os.environ['PREFECT_API_KEY'] = ''
+        os.environ['PREFECT_API_URL'] = ''
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/raw/index.html b/docs/mkdocs_site/reference/omnipy/modules/raw/index.html new file mode 100644 index 00000000..405ba366 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/raw/index.html @@ -0,0 +1,2282 @@ + + + + + + + + + + + + + + + + + + + + + + raw - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

raw

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/raw/protocols/index.html b/docs/mkdocs_site/reference/omnipy/modules/raw/protocols/index.html new file mode 100644 index 00000000..9388b4c5 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/raw/protocols/index.html @@ -0,0 +1,2661 @@ + + + + + + + + + + + + + + + + + + + + + + protocols - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

protocols

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ IsModifyAllLinesCallable + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/modules/raw/protocols.py +
16
+17
+18
+19
class IsModifyAllLinesCallable(Protocol):
+    """"""
+    def __call__(self, all_lines: List[str], **kwargs: object) -> List[str]:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__call__(all_lines, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/protocols.py +
18
+19
def __call__(self, all_lines: List[str], **kwargs: object) -> List[str]:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsModifyContentsCallable + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/modules/raw/protocols.py +
4
+5
+6
+7
class IsModifyContentsCallable(Protocol):
+    """"""
+    def __call__(self, data_file: str, **kwargs: object) -> str:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__call__(data_file, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/protocols.py +
6
+7
def __call__(self, data_file: str, **kwargs: object) -> str:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsModifyEachLineCallable + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/modules/raw/protocols.py +
10
+11
+12
+13
class IsModifyEachLineCallable(Protocol):
+    """"""
+    def __call__(self, line_no: int, line: str, **kwargs: object) -> str:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__call__(line_no, line, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/protocols.py +
12
+13
def __call__(self, line_no: int, line: str, **kwargs: object) -> str:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/raw/serializers/index.html b/docs/mkdocs_site/reference/omnipy/modules/raw/serializers/index.html new file mode 100644 index 00000000..df5446a9 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/raw/serializers/index.html @@ -0,0 +1,2717 @@ + + + + + + + + + + + + + + + + + + + + + + serializers - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

serializers

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ RawDatasetToTarFileSerializer + + +

+ + +
+

+ Bases: TarFileSerializer

+ + + + + +
+ Source code in src/omnipy/modules/raw/serializers.py +
10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
class RawDatasetToTarFileSerializer(TarFileSerializer):
+    """"""
+    @classmethod
+    def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:
+        return type(dataset) == Dataset[Model[str]]
+
+    @classmethod
+    def get_dataset_cls_for_new(cls) -> Type[Dataset]:
+        return Dataset[Model[str]]
+
+    @classmethod
+    def get_output_file_suffix(cls) -> str:
+        return 'raw'
+
+    @classmethod
+    def serialize(cls, dataset: Dataset[Model[str]]) -> bytes:
+        def raw_encode_func(contents: str) -> bytes:
+            return contents.encode('utf8')
+
+        return cls.create_tarfile_from_dataset(dataset, data_encode_func=raw_encode_func)
+
+    @classmethod
+    def deserialize(cls, tarfile_bytes: bytes) -> Dataset[Model[str]]:
+        dataset = Dataset[Model[str]]()
+
+        def raw_decode_func(file_stream: IO[bytes]) -> str:
+            return file_stream.read().decode('utf8')
+
+        def python_dictify_object(obj_type: str, obj_val: Any) -> Dict:
+            return {obj_type: obj_val}
+
+        cls.create_dataset_from_tarfile(
+            dataset,
+            tarfile_bytes,
+            data_decode_func=raw_decode_func,
+            dictify_object_func=python_dictify_object,
+            import_method='from_data')  # noqa
+
+        return dataset
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+deserialize(tarfile_bytes) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/serializers.py +
31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
@classmethod
+def deserialize(cls, tarfile_bytes: bytes) -> Dataset[Model[str]]:
+    dataset = Dataset[Model[str]]()
+
+    def raw_decode_func(file_stream: IO[bytes]) -> str:
+        return file_stream.read().decode('utf8')
+
+    def python_dictify_object(obj_type: str, obj_val: Any) -> Dict:
+        return {obj_type: obj_val}
+
+    cls.create_dataset_from_tarfile(
+        dataset,
+        tarfile_bytes,
+        data_decode_func=raw_decode_func,
+        dictify_object_func=python_dictify_object,
+        import_method='from_data')  # noqa
+
+    return dataset
+
+
+
+ +
+ +
+ + + +

+get_dataset_cls_for_new() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/serializers.py +
16
+17
+18
@classmethod
+def get_dataset_cls_for_new(cls) -> Type[Dataset]:
+    return Dataset[Model[str]]
+
+
+
+ +
+ +
+ + + +

+get_output_file_suffix() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/serializers.py +
20
+21
+22
@classmethod
+def get_output_file_suffix(cls) -> str:
+    return 'raw'
+
+
+
+ +
+ +
+ + + +

+is_dataset_directly_supported(dataset) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/serializers.py +
12
+13
+14
@classmethod
+def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:
+    return type(dataset) == Dataset[Model[str]]
+
+
+
+ +
+ +
+ + + +

+serialize(dataset) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/serializers.py +
24
+25
+26
+27
+28
+29
@classmethod
+def serialize(cls, dataset: Dataset[Model[str]]) -> bytes:
+    def raw_encode_func(contents: str) -> bytes:
+        return contents.encode('utf8')
+
+    return cls.create_tarfile_from_dataset(dataset, data_encode_func=raw_encode_func)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/raw/tasks/index.html b/docs/mkdocs_site/reference/omnipy/modules/raw/tasks/index.html new file mode 100644 index 00000000..d75076d2 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/raw/tasks/index.html @@ -0,0 +1,2480 @@ + + + + + + + + + + + + + + + + + + + + + + tasks - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

tasks

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+modify_all_lines(data_file, modify_all_lines_func, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/tasks.py +
35
+36
+37
+38
+39
+40
+41
+42
+43
+44
@mypy_fix_task_template
+@TaskTemplate(iterate_over_data_files=True)
+def modify_all_lines(
+    data_file: str,
+    modify_all_lines_func: IsModifyAllLinesCallable,
+    **kwargs: object,
+) -> str:
+    all_lines = [line.strip() for line in StringIO(data_file)]
+    modified_lines = modify_all_lines_func(all_lines, **kwargs)
+    return os.linesep.join(modified_lines)
+
+
+
+ +
+ +
+ + + +

+modify_datafile_contents(data_file, modify_contents_func, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/tasks.py +
10
+11
+12
+13
+14
+15
+16
+17
@mypy_fix_task_template
+@TaskTemplate(iterate_over_data_files=True)
+def modify_datafile_contents(
+    data_file: str,
+    modify_contents_func: IsModifyContentsCallable,
+    **kwargs: object,
+) -> str:
+    return modify_contents_func(data_file, **kwargs)
+
+
+
+ +
+ +
+ + + +

+modify_each_line(data_file, modify_line_func, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/modules/raw/tasks.py +
20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
@mypy_fix_task_template
+@TaskTemplate(iterate_over_data_files=True)
+def modify_each_line(
+    data_file: str,
+    modify_line_func: IsModifyEachLineCallable,
+    **kwargs: object,
+) -> str:
+    output_data = StringIO()
+    for i, line in enumerate(StringIO(data_file)):
+        modified_line = modify_line_func(i, line, **kwargs)
+        if modified_line is not None:
+            output_data.write(modified_line)
+    return output_data.getvalue()
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/tables/index.html b/docs/mkdocs_site/reference/omnipy/modules/tables/index.html new file mode 100644 index 00000000..189c4d67 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/tables/index.html @@ -0,0 +1,2282 @@ + + + + + + + + + + + + + + + + + + + + + + tables - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

tables

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/tables/models/index.html b/docs/mkdocs_site/reference/omnipy/modules/tables/models/index.html new file mode 100644 index 00000000..d1399035 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/tables/models/index.html @@ -0,0 +1,2448 @@ + + + + + + + + + + + + + + + + + + + + + + models - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

models

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ JsonTableOfStrings + + +

+ + +
+

+ Bases: JsonListModel[JsonDictModel[str]]

+ + + +
+ Source code in src/omnipy/modules/tables/models.py +
11
+12
class JsonTableOfStrings(JsonListModel[JsonDictModel[str]]):
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ TableOfStrings + + +

+ + +
+

+ Bases: Model[List[Dict[str, str]]]

+ + + +
+ Source code in src/omnipy/modules/tables/models.py +
7
+8
class TableOfStrings(Model[List[Dict[str, str]]]):
+    ...
+
+
+ +
+ +
+ +
+ + + +

+ TableOfStringsAndLists + + +

+ + +
+

+ Bases: Model[List[Dict[str, Union[str, List[str]]]]]

+ + + +
+ Source code in src/omnipy/modules/tables/models.py +
15
+16
class TableOfStringsAndLists(Model[List[Dict[str, Union[str, List[str]]]]]):
+    ...
+
+
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/modules/tables/tasks/index.html b/docs/mkdocs_site/reference/omnipy/modules/tables/tasks/index.html new file mode 100644 index 00000000..67f7bc67 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/modules/tables/tasks/index.html @@ -0,0 +1,2382 @@ + + + + + + + + + + + + + + + + + + + + + + tasks - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

tasks

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+remove_columns(json_dataset, column_keys_for_data_items) + +

+ + +
+ +
+ Source code in src/omnipy/modules/tables/tasks.py +
 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
@mypy_fix_task_template
+@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?
+    #
+    dataset_copy = deepcopy(json_dataset)
+    for data_item_key, column_keys in column_keys_for_data_items.items():
+        for record in dataset_copy[data_item_key]:
+            for column in column_keys:
+                if column in record:
+                    del record[column]
+    return JsonListOfDictsOfAnyDataset(json_dataset.to_data())
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/util/callable_decorator_cls/index.html b/docs/mkdocs_site/reference/omnipy/util/callable_decorator_cls/index.html new file mode 100644 index 00000000..12e0729f --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/util/callable_decorator_cls/index.html @@ -0,0 +1,2544 @@ + + + + + + + + + + + + + + + + + + + + + + callable_decorator_cls - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

callable_decorator_cls

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+callable_decorator_cls(cls) + +

+ + +
+ +

"Meta-decorator" that allows any class to function as a decorator for a callable.

+

The only requirements are that 1) the first argument after self of the init() method needs +to be annotated as a callable, and 2) the class must not already be callable (have a call() +method).

+

Arguments and keyword arguments to the class decorator are supported.

+ +
+ Source code in src/omnipy/util/callable_decorator_cls.py +
  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
def callable_decorator_cls(cls: Type[DecoratorClassT]) -> IsCallableClass[DecoratorClassT]:
+    """
+    "Meta-decorator" that allows any class to function as a decorator for a callable.
+
+    The only requirements are that 1) the first argument after self of the __init__() method needs
+    to be annotated as a callable, and 2) the class must not already be callable (have a __call__()
+    method).
+
+    Arguments and keyword arguments to the class decorator are supported.
+    """
+    if not isinstance(cls.__call__, MethodWrapperType):
+        cls._wrapped_call: Callable = cast(Callable, cls.__call__)
+
+    def _forward_call_to_obj_if_callable(self, *args: object,
+                                         **kwargs: object) -> Type[DecoratorClassT]:
+        """
+        __call__ method at the class level which forward the call to instance-level call methods,
+        if present (hardcoded as '_obj_call()'). This is needed due to the peculiarity that Python
+        only looks up special methods (with double underscores) at the class level, and not at the
+        instance level. Used in the decoration process to forward __call__ calls to the object level
+        _obj_call() methods, if present.
+
+        See: https://stackoverflow.com/q/33824228
+        """
+        if hasattr(self, '_obj_call'):
+            return self._obj_call(*args, **kwargs)
+        if hasattr(self, '_wrapped_call'):
+            return self._wrapped_call(*args, **kwargs)
+        raise TypeError("'{}' object is not callable".format(self.__class__.__name__))
+
+    setattr(cls, '__call__', _forward_call_to_obj_if_callable)
+
+    def _real_callable(arg: object) -> bool:
+        """
+        Helper method needed to ignore the class level __call__ method when checking whether the
+        decorated class is callable.
+        """
+        if callable(arg):
+            if hasattr(arg, '__call__'):
+                if hasattr(arg.__call__, '__func__'):
+                    # due to mypy bug: https://github.com/python/mypy/issues/14123
+                    call_func_name = getattr(arg.__call__, '__func__').__name__
+
+                    if call_func_name == _forward_call_to_obj_if_callable.__name__:
+                        return False
+            return True
+        return False
+
+    _wrapped_new: Callable = cls.__new__
+
+    def _new_wrapper(cls, *args: object, **kwargs: object) -> DecoratorClassT:
+        if _wrapped_new is object.__new__:
+            obj = _wrapped_new(cls)
+        else:
+            obj = _wrapped_new(cls, *args, **kwargs)
+            # setattr(cls, '__new__', _wrapped_new)
+
+        _wrapped_init: IsCallableParamAfterSelf = cast(IsCallableParamAfterSelf,
+                                                       obj.__class__.__init__)
+
+        # Wrapper method that replaces the __init__ method of the decorated class
+        def _init_wrapper(self, *args: object, **kwargs: object) -> None:
+            args_list = list(args)
+
+            def _init(callable_arg: Callable) -> None:
+                _wrapped_init(self, callable_arg, *args_list, **kwargs)
+                update_wrapper(self, callable_arg, updated=[])
+
+            if len(args_list) == 1 and _real_callable(args_list[0]):
+                # Decorate the callable directly
+                _callable_arg: Callable = cast(Callable, args_list[0])
+                args_list.pop(0)
+                _init(_callable_arg)
+            else:
+                # Add an instance-level _obj_call method, which are again callable by the
+                # class-level __call__ method. When this method is called, the provided _callable_arg
+                # is decorated.
+                def _init_as_obj_call_method(
+                        self, _callable_arg: Callable) -> Type[DecoratorClassT]:  # noqa
+                    _init(_callable_arg)
+                    del self._obj_call
+                    return self
+
+                self._obj_call = _init_as_obj_call_method.__get__(self)
+
+            setattr(self.__class__, '__init__', _wrapped_init)
+
+        setattr(obj.__class__, '__init__', _init_wrapper)
+
+        return obj
+
+    setattr(cls, '__new__', _new_wrapper)
+
+    return cast(IsCallableClass[DecoratorClassT], cls)
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/util/dataframe/index.html b/docs/mkdocs_site/reference/omnipy/util/dataframe/index.html new file mode 100644 index 00000000..04df719c --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/util/dataframe/index.html @@ -0,0 +1,2480 @@ + + + + + + + + + + + + + + + + + + + + + + dataframe - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

dataframe

+ +
+ + + +
+ + + +
+ + + + + + + + + +
+ + + +

+extract_subtable_by_labels(df, row_labels=None, col_labels=None, row_level=None, col_level=None) + +

+ + +
+ +
+ Source code in src/omnipy/util/dataframe.py +
28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
def extract_subtable_by_labels(df,
+                               row_labels=None,
+                               col_labels=None,
+                               row_level=None,
+                               col_level=None):
+    if row_labels:
+        rows = [df.xs(row, axis=0, level=row_level, drop_level=False) for row in row_labels]
+        df = pd.concat(rows)
+    if col_labels:
+        cols = [df.xs(col, axis=1, level=col_level, drop_level=False) for col in col_labels]
+        df = pd.concat(cols, axis=1)
+    return df
+
+
+
+ +
+ +
+ + + +

+select_from_labels(df, labels, axis, level, invert=False) + +

+ + +
+ +
+ Source code in src/omnipy/util/dataframe.py +
18
+19
+20
+21
+22
+23
+24
+25
def select_from_labels(df, labels, axis, level, invert=False):
+    assert axis in [0, 1]
+    assert level in [0, 1]
+
+    idx = df.index.levels[level] if axis == 0 else df.columns.levels[level]
+    filtered_idx = idx[~idx.isin(labels)] if invert else idx[idx.isin(labels)]
+    formatted_idx = tuple(filtered_idx)
+    return formatted_idx
+
+
+
+ +
+ +
+ + + +

+split_dataframe(df, row_labels_to_move, col_labels_to_move, row_level=1, col_level=0) + +

+ + +
+ +
+ Source code in src/omnipy/util/dataframe.py +
 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
def split_dataframe(df, row_labels_to_move, col_labels_to_move, row_level=1, col_level=0):
+    mv_rows = select_from_labels(df, row_labels_to_move, axis=0, level=row_level)
+    kp_rows = select_from_labels(df, row_labels_to_move, axis=0, level=row_level, invert=True)
+    mv_cols = select_from_labels(df, col_labels_to_move, axis=1, level=col_level)
+    kp_cols = select_from_labels(df, col_labels_to_move, axis=1, level=col_level, invert=True)
+
+    kp_df = extract_subtable_by_labels(df, kp_rows, kp_cols, row_level, col_level)
+    new_row_df = extract_subtable_by_labels(df, kp_rows, mv_cols, row_level, col_level)
+    new_col_df = extract_subtable_by_labels(df, mv_rows, kp_cols, row_level, col_level)
+    new_row_col_df = extract_subtable_by_labels(df, mv_rows, mv_cols, row_level, col_level)
+
+    return kp_df, new_row_df, new_col_df, new_row_col_df
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/util/helpers/index.html b/docs/mkdocs_site/reference/omnipy/util/helpers/index.html new file mode 100644 index 00000000..d744dce5 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/util/helpers/index.html @@ -0,0 +1,2733 @@ + + + + + + + + + + + + + + + + + + + + + + helpers - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + +

helpers

+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+Dictable = Union[Mapping[object, object], Iterable[Tuple[object, object]]] + + + module-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+as_dictable(obj) + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
14
+15
+16
+17
+18
+19
+20
+21
+22
def as_dictable(obj: object) -> Optional[Dictable]:
+    def _is_iterable_of_tuple_pairs(obj_inner: object) -> bool:
+        return isinstance(obj_inner, Iterable) and \
+            all(isinstance(el, tuple) and len(el) == 2 for el in obj_inner)
+
+    if isinstance(obj, Mapping) or _is_iterable_of_tuple_pairs(obj):
+        return cast(Dictable, obj)
+    else:
+        return None
+
+
+
+ +
+ +
+ + + +

+create_merged_dict(dictable_1, dictable_2) + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
25
+26
+27
+28
+29
def create_merged_dict(dictable_1: Dictable, dictable_2: Dictable) -> Dict[object, object]:
+    merged_dict = dictable_1 if isinstance(dictable_1, dict) else dict(dictable_1)
+    dict_2 = dictable_2 if isinstance(dictable_2, dict) else dict(dictable_2)
+    merged_dict |= dict_2
+    return merged_dict
+
+
+
+ +
+ +
+ + + +

+generic_aware_issubclass_ignore_args(cls, cls_or_tuple) + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
59
+60
+61
+62
+63
def generic_aware_issubclass_ignore_args(cls, cls_or_tuple):
+    try:
+        return issubclass(cls, cls_or_tuple)
+    except TypeError:
+        return issubclass(get_origin(cls), cls_or_tuple)
+
+
+
+ +
+ +
+ + + +

+get_bases(cls) + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
55
+56
def get_bases(cls):
+    return get_generic_bases(cls) if is_generic_type(cls) else cls.__bases__
+
+
+
+ +
+ +
+ + + +

+get_datetime_format(locale=None) + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
36
+37
+38
+39
+40
+41
+42
+43
def get_datetime_format(locale: Optional[LocaleType] = None) -> str:
+    pkg_locale.setlocale(pkg_locale.LC_ALL, locale)
+
+    if hasattr(pkg_locale, 'nl_langinfo'):  # noqa
+        datetime_format = pkg_locale.nl_langinfo(pkg_locale.D_T_FMT)
+    else:
+        datetime_format = '%a %b %e %X %Y'
+    return datetime_format
+
+
+
+ +
+ +
+ + + +

+remove_none_vals(**kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
32
+33
def remove_none_vals(**kwargs: object) -> Dict[object, object]:
+    return {key: val for key, val in kwargs.items() if val is not None}
+
+
+
+ +
+ +
+ + + +

+repr_max_len(data, max_len=200) + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
50
+51
+52
def repr_max_len(data: object, max_len: int = 200):
+    repr_str = repr(data)
+    return f'{repr_str[:max_len]}...' if len(repr_str) > max_len else repr_str
+
+
+
+ +
+ +
+ + + +

+resolve(val) + + + async + + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
46
+47
async def resolve(val):
+    return await val if inspect.isawaitable(val) else val
+
+
+
+ +
+ +
+ + + +

+transfer_generic_args_to_cls(to_cls, from_generic_type) + +

+ + +
+ +
+ Source code in src/omnipy/util/helpers.py +
66
+67
+68
+69
+70
def transfer_generic_args_to_cls(to_cls, from_generic_type):
+    try:
+        return to_cls[get_args(from_generic_type)]
+    except (TypeError, AttributeError):
+        return to_cls
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/util/index.html b/docs/mkdocs_site/reference/omnipy/util/index.html new file mode 100644 index 00000000..ad18bd65 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/util/index.html @@ -0,0 +1,2280 @@ + + + + + + + + + + + + + + + + + + + + + + util - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

util

+ +
+ + + +
+ + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/util/mixin/index.html b/docs/mkdocs_site/reference/omnipy/util/mixin/index.html new file mode 100644 index 00000000..228ac7c6 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/util/mixin/index.html @@ -0,0 +1,3179 @@ + + + + + + + + + + + + + + + + + + + + + + mixin - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

mixin

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ DynamicMixinAcceptor + + +

+ + +
+ + + +
+ Source code in src/omnipy/util/mixin.py +
 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
class DynamicMixinAcceptor:
+    # Constants
+    WITH_MIXINS_CLS_PREFIX = 'WithMixins'
+
+    # Declarations needed by mypy
+    _orig_class: Type
+    _orig_init_signature: inspect.Signature
+    _mixin_classes: List[Type]
+    _init_params_per_mixin_cls: DefaultDict[str, DefaultDict[str, inspect.Parameter]]
+
+    def __class_getitem__(cls, item):
+        return super().__class_getitem__(item)
+
+    def __init_subclass__(cls, **kwargs):
+        super().__init_subclass__(**kwargs)
+
+        if DynamicMixinAcceptor in get_bases(cls) and cls.__init__ is object.__init__:
+            raise TypeError(
+                'Dynamic mixin acceptor class is required to define a __init__() method.')
+
+        cls._orig_init_signature = inspect.signature(cls.__init__)
+        cls._mixin_classes = []
+        cls._init_params_per_mixin_cls = defaultdict(defaultdict)
+
+    @classmethod
+    def _get_mixin_init_kwarg_params(cls) -> Dict[str, inspect.Parameter]:
+        return {
+            key: param for param_dict in cls._init_params_per_mixin_cls.values() for key,
+            param in param_dict.items()
+        }
+
+    @property
+    def _mixin_init_kwarg_params(self) -> Dict[str, inspect.Parameter]:
+        return self._get_mixin_init_kwarg_params()
+
+    @classmethod
+    def _get_mixin_init_kwarg_params_including_bases(cls) -> Dict[str, inspect.Parameter]:
+        all_mixin_init_kwarg_params: Dict[str, inspect.Parameter] = {}
+
+        base_list = list(cls.__mro__)
+        skip_bases = {'DynamicMixinAcceptor'}
+
+        for base in base_list:
+            if base.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX):
+                skip_bases.add(base.__name__[:-len(cls.WITH_MIXINS_CLS_PREFIX)])
+
+        cleaned_base_list = [
+            base for base in base_list
+            if issubclass(base, DynamicMixinAcceptor) and base.__name__ not in skip_bases
+        ]
+
+        for base in cleaned_base_list:
+            all_mixin_init_kwarg_params |= dict(base._get_mixin_init_kwarg_params().items())
+
+        return all_mixin_init_kwarg_params
+
+    @property
+    def _mixin_init_kwarg_params_including_bases(self) -> Dict[str, inspect.Parameter]:
+        return self._get_mixin_init_kwarg_params_including_bases()
+
+    @classmethod
+    def accept_mixin(cls, mixin_cls: Type) -> None:
+        cls._accept_mixin(mixin_cls, update=True)
+
+    @classmethod
+    def _accept_mixin(cls, mixin_cls: Type, update: bool):
+        cls._mixin_classes.append(mixin_cls)
+
+        if '__init__' in mixin_cls.__dict__:
+            cls._store_init_signature_params_for_mixin(mixin_cls)
+
+            if update:
+                cls._update_cls_init_signature_with_kwargs_all_mixin_kwargs()
+
+    @classmethod
+    def _store_init_signature_params_for_mixin(cls, mixin_cls):
+        for key, param in inspect.signature(mixin_cls.__init__).parameters.items():
+            if key != 'self':
+                if param.kind not in (param.KEYWORD_ONLY, param.VAR_KEYWORD):
+                    raise AttributeError(
+                        'All params in the signature of the __init__() method in a dynamic '
+                        'mixin class must be keyword-only or var-keyword '
+                        '(except for the "self" param)')
+                if param.kind == param.KEYWORD_ONLY:
+                    cls._init_params_per_mixin_cls[mixin_cls.__name__][key] = param
+
+    @classmethod
+    def _update_cls_init_signature_with_kwargs_all_mixin_kwargs(cls):
+        updated_init_signature = cls._get_updated_cls_init_signature_with_all_mixin_kwargs()
+
+        cls.__init__.__signature__ = updated_init_signature
+        if hasattr(cls, '_orig_class'):
+            cls._orig_class.__init____signature__ = updated_init_signature
+
+    @classmethod
+    def _get_updated_cls_init_signature_with_all_mixin_kwargs(cls):
+        orig_init_param_dict = cls._orig_init_signature.parameters
+        init_params = list(orig_init_param_dict.values())
+        opt_var_keyword_param = []
+
+        if init_params[-1].kind == inspect.Parameter.VAR_KEYWORD:
+            opt_var_keyword_param = [init_params[-1]]
+            init_params = init_params[:-1]
+
+        only_mixin_params = [
+            val for (key, val) in cls._get_mixin_init_kwarg_params_including_bases().items()
+            if key not in orig_init_param_dict
+        ]
+
+        updated_params = init_params + only_mixin_params + opt_var_keyword_param
+        return cls._orig_init_signature.replace(parameters=updated_params)
+
+    @classmethod
+    def reset_mixins(cls):
+        cls._mixin_classes.clear()
+        cls._init_params_per_mixin_cls.clear()
+        cls.__init__.__signature__ = cls._orig_init_signature
+
+    def __new__(cls, *args, **kwargs):
+        if not cls.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX):
+            cls_with_mixins = cls._create_subcls_inheriting_from_mixins_and_orig_cls()
+            obj = super(cls, cls_with_mixins).__new__(cls_with_mixins, *args, **kwargs)
+
+        else:
+            obj = object.__new__(cls)
+
+        cls._update_cls_init_signature_with_kwargs_all_mixin_kwargs()
+        return obj
+
+    @classmethod
+    def _create_subcls_inheriting_from_mixins_and_orig_cls(cls):
+
+        # TODO: Refactor this, and possibly elsewhere in class
+
+        def __init__(self, *args, **kwargs):
+            # print(f'__init__ for obj of class: {self.__class__.__name__}')
+            cls.__init__(self, *args, **kwargs)
+            mixin_kwargs_defaults = {}
+
+            for base in cls_with_mixins.__mro__:
+                if base == cls \
+                        or base.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX) \
+                        or base.__init__ is object.__init__:
+                    continue
+
+                mixin_kwargs = {}
+                contains_positional = False
+
+                for key, param in inspect.signature(base.__init__).parameters.items():
+                    if key != 'self':
+                        if param.kind == param.KEYWORD_ONLY:
+                            if key in kwargs:
+                                mixin_kwargs[key] = kwargs[key]
+                            elif key in mixin_kwargs_defaults:
+                                mixin_kwargs[key] = mixin_kwargs_defaults[key]
+                            else:
+                                mixin_kwargs_defaults[key] = param.default
+                        elif param.kind in (param.POSITIONAL_ONLY,
+                                            param.POSITIONAL_OR_KEYWORD,
+                                            param.VAR_POSITIONAL):
+                            contains_positional = True
+
+                if contains_positional:
+                    # print(f'Calling... {base.__name__}(args={args}, kwargs={mixin_kwargs})')
+                    base.__init__(self, *args, **mixin_kwargs)
+                else:
+                    # print(f'Calling... {base.__name__}(kwargs={mixin_kwargs})')
+                    base.__init__(self, **mixin_kwargs)
+
+        cls_bases = list(get_bases(cls))
+        if not cls.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX):
+            cls_bases = list(cls._mixin_classes) + cls_bases
+
+        cls_bases_with_mixins = []
+
+        for cls_base in cls_bases:
+
+            if cls._is_true_acceptor_subclass(cls_base):
+                cls_new_base = cls_base._create_subcls_inheriting_from_mixins_and_orig_cls()
+                cls_base = transfer_generic_args_to_cls(cls_new_base, cls_base)
+
+            cls_bases_with_mixins.append(cls_base)
+
+        def fill_ns(ns):
+            ns |= dict(__init__=__init__)
+            return ns
+
+        cls_with_mixins = types.new_class(
+            f'{cls.__name__}{cls.WITH_MIXINS_CLS_PREFIX}',
+            tuple([cls] + cls_bases_with_mixins),
+            {},
+            fill_ns,
+        )
+        cls_with_mixins.__module__ = cls.__module__
+
+        cls_with_mixins._orig_class = cls
+        cls_with_mixins._orig_init_signature = inspect.signature(cls.__init__)
+
+        for mixin_cls in cls._mixin_classes:
+            cls_with_mixins._accept_mixin(mixin_cls, update=False)
+
+        return cls_with_mixins
+
+    @staticmethod
+    def _is_true_acceptor_subclass(cls):
+        if cls == DynamicMixinAcceptor:
+            return False
+        return generic_aware_issubclass_ignore_args(cls, DynamicMixinAcceptor)
+
+
+ + + +
+ + + + + + + +
+ + + +

+WITH_MIXINS_CLS_PREFIX = 'WithMixins' + + + instance-attribute + class-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+__class_getitem__(item) + +

+ + +
+ +
+ Source code in src/omnipy/util/mixin.py +
27
+28
def __class_getitem__(cls, item):
+    return super().__class_getitem__(item)
+
+
+
+ +
+ +
+ + + +

+__init_subclass__(**kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/util/mixin.py +
30
+31
+32
+33
+34
+35
+36
+37
+38
+39
def __init_subclass__(cls, **kwargs):
+    super().__init_subclass__(**kwargs)
+
+    if DynamicMixinAcceptor in get_bases(cls) and cls.__init__ is object.__init__:
+        raise TypeError(
+            'Dynamic mixin acceptor class is required to define a __init__() method.')
+
+    cls._orig_init_signature = inspect.signature(cls.__init__)
+    cls._mixin_classes = []
+    cls._init_params_per_mixin_cls = defaultdict(defaultdict)
+
+
+
+ +
+ +
+ + + +

+__new__(*args, **kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/util/mixin.py +
135
+136
+137
+138
+139
+140
+141
+142
+143
+144
def __new__(cls, *args, **kwargs):
+    if not cls.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX):
+        cls_with_mixins = cls._create_subcls_inheriting_from_mixins_and_orig_cls()
+        obj = super(cls, cls_with_mixins).__new__(cls_with_mixins, *args, **kwargs)
+
+    else:
+        obj = object.__new__(cls)
+
+    cls._update_cls_init_signature_with_kwargs_all_mixin_kwargs()
+    return obj
+
+
+
+ +
+ +
+ + + +

+accept_mixin(mixin_cls) + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/util/mixin.py +
77
+78
+79
@classmethod
+def accept_mixin(cls, mixin_cls: Type) -> None:
+    cls._accept_mixin(mixin_cls, update=True)
+
+
+
+ +
+ +
+ + + +

+reset_mixins() + + + classmethod + + +

+ + +
+ +
+ Source code in src/omnipy/util/mixin.py +
129
+130
+131
+132
+133
@classmethod
+def reset_mixins(cls):
+    cls._mixin_classes.clear()
+    cls._init_params_per_mixin_cls.clear()
+    cls.__init__.__signature__ = cls._orig_init_signature
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ IsMixin + + +

+ + +
+

+ Bases: Protocol

+ + + + + +
+ Source code in src/omnipy/util/mixin.py +
11
+12
+13
+14
class IsMixin(Protocol):
+    """"""
+    def __init__(self, **kwargs: object) -> None:
+        ...
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__init__(**kwargs) + +

+ + +
+ +
+ Source code in src/omnipy/util/mixin.py +
13
+14
def __init__(self, **kwargs: object) -> None:
+    ...
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/util/param_key_mapper/index.html b/docs/mkdocs_site/reference/omnipy/util/param_key_mapper/index.html new file mode 100644 index 00000000..fdc85e55 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/util/param_key_mapper/index.html @@ -0,0 +1,2661 @@ + + + + + + + + + + + + + + + + + + + + + + param_key_mapper - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+ +
+
+ + + +
+
+ + + + +

param_key_mapper

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ ParamKeyMapper + + +

+ + +
+ + + +
+ Source code in src/omnipy/util/param_key_mapper.py +
 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
class ParamKeyMapper:
+    def __init__(self, key_map: Mapping[str, str]):
+        self.key_map = dict(key_map)
+        self._inverse_key_map = {val: key for key, val in self.key_map.items()}
+
+        if len(self.key_map) != len(self._inverse_key_map):
+            raise ValueError('Some values were dropped when translating to the inverse key_map!')
+
+    def _get_key_map(self, inverse: bool):
+        return self._inverse_key_map if inverse else self.key_map
+
+    def map_matching_keys(self,
+                          params: Mapping[str, Any],
+                          inverse: bool,
+                          keep_non_matching_keys: bool):
+        key_map = self._get_key_map(inverse)
+        keys = params.keys() if keep_non_matching_keys else [
+            key for key in params if key in key_map
+        ]
+        return {key_map[key] if key in key_map else key: params[key] for key in keys}
+
+    def delete_matching_keys(self, params: Mapping[str, Any], inverse: bool):
+        key_map = self._get_key_map(inverse)
+        return {key: params[key] for key in params if key not in key_map}
+
+    def map_matching_keys_delete_inverse_matches_keep_rest(self,
+                                                           params: Mapping[str, Any],
+                                                           inverse: bool):
+        params = self.delete_matching_keys(params, not inverse)
+        params = self.map_matching_keys(params, inverse, keep_non_matching_keys=True)
+
+        return params
+
+
+ + + +
+ + + + + + + +
+ + + +

+key_map = dict(key_map) + + + instance-attribute + + +

+ + +
+
+ +
+ + + +
+ + + +

+__init__(key_map) + +

+ + +
+ +
+ Source code in src/omnipy/util/param_key_mapper.py +
 5
+ 6
+ 7
+ 8
+ 9
+10
def __init__(self, key_map: Mapping[str, str]):
+    self.key_map = dict(key_map)
+    self._inverse_key_map = {val: key for key, val in self.key_map.items()}
+
+    if len(self.key_map) != len(self._inverse_key_map):
+        raise ValueError('Some values were dropped when translating to the inverse key_map!')
+
+
+
+ +
+ +
+ + + +

+delete_matching_keys(params, inverse) + +

+ + +
+ +
+ Source code in src/omnipy/util/param_key_mapper.py +
25
+26
+27
def delete_matching_keys(self, params: Mapping[str, Any], inverse: bool):
+    key_map = self._get_key_map(inverse)
+    return {key: params[key] for key in params if key not in key_map}
+
+
+
+ +
+ +
+ + + +

+map_matching_keys(params, inverse, keep_non_matching_keys) + +

+ + +
+ +
+ Source code in src/omnipy/util/param_key_mapper.py +
15
+16
+17
+18
+19
+20
+21
+22
+23
def map_matching_keys(self,
+                      params: Mapping[str, Any],
+                      inverse: bool,
+                      keep_non_matching_keys: bool):
+    key_map = self._get_key_map(inverse)
+    keys = params.keys() if keep_non_matching_keys else [
+        key for key in params if key in key_map
+    ]
+    return {key_map[key] if key in key_map else key: params[key] for key in keys}
+
+
+
+ +
+ +
+ + + +

+map_matching_keys_delete_inverse_matches_keep_rest(params, inverse) + +

+ + +
+ +
+ Source code in src/omnipy/util/param_key_mapper.py +
29
+30
+31
+32
+33
+34
+35
def map_matching_keys_delete_inverse_matches_keep_rest(self,
+                                                       params: Mapping[str, Any],
+                                                       inverse: bool):
+    params = self.delete_matching_keys(params, not inverse)
+    params = self.map_matching_keys(params, inverse, keep_non_matching_keys=True)
+
+    return params
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/reference/omnipy/util/publisher/index.html b/docs/mkdocs_site/reference/omnipy/util/publisher/index.html new file mode 100644 index 00000000..71176ff8 --- /dev/null +++ b/docs/mkdocs_site/reference/omnipy/util/publisher/index.html @@ -0,0 +1,2561 @@ + + + + + + + + + + + + + + + + + + + + publisher - Omnipy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + +

publisher

+ +
+ + + +
+ + + +
+ + + + + + + + +
+ + + +

+ DataPublisher + + + + dataclass + + +

+ + +
+ + + +
+ Source code in src/omnipy/util/publisher.py +
10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
@dataclass
+class DataPublisher:
+    _subscriptions: DefaultDict[str, List[Callable[[Any], None]]] = \
+        field(default_factory=_subscribers_factory, init=False, repr=False)
+
+    def subscribe(self, config_item: str, callback_fun: Callable[[Any], None]):
+        if not hasattr(self, config_item):
+            raise AttributeError(f'No config items named "{config_item}"')
+        elif config_item.startswith('_'):
+            raise AttributeError(f'Subscribing to private member "{config_item}" not allowed')
+        else:
+            self._subscriptions[config_item].append(callback_fun)
+            callback_fun(getattr(self, config_item))
+
+    def unsubscribe_all(self) -> None:
+        self._subscriptions = _subscribers_factory()
+
+    def __setattr__(self, key, value):
+        super().__setattr__(key, value)
+
+        if key in self._subscriptions:
+            for callback_fun in self._subscriptions[key]:
+                callback_fun(value)
+
+
+ + + +
+ + + + + + + + + +
+ + + +

+__setattr__(key, value) + +

+ + +
+ +
+ Source code in src/omnipy/util/publisher.py +
27
+28
+29
+30
+31
+32
def __setattr__(self, key, value):
+    super().__setattr__(key, value)
+
+    if key in self._subscriptions:
+        for callback_fun in self._subscriptions[key]:
+            callback_fun(value)
+
+
+
+ +
+ +
+ + + +

+subscribe(config_item, callback_fun) + +

+ + +
+ +
+ Source code in src/omnipy/util/publisher.py +
15
+16
+17
+18
+19
+20
+21
+22
def subscribe(self, config_item: str, callback_fun: Callable[[Any], None]):
+    if not hasattr(self, config_item):
+        raise AttributeError(f'No config items named "{config_item}"')
+    elif config_item.startswith('_'):
+        raise AttributeError(f'Subscribing to private member "{config_item}" not allowed')
+    else:
+        self._subscriptions[config_item].append(callback_fun)
+        callback_fun(getattr(self, config_item))
+
+
+
+ +
+ +
+ + + +

+unsubscribe_all() + +

+ + +
+ +
+ Source code in src/omnipy/util/publisher.py +
24
+25
def unsubscribe_all(self) -> None:
+    self._subscriptions = _subscribers_factory()
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docs/mkdocs_site/search/search_index.json b/docs/mkdocs_site/search/search_index.json new file mode 100644 index 00000000..278f242f --- /dev/null +++ b/docs/mkdocs_site/search/search_index.json @@ -0,0 +1 @@ +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to MkDocs","text":"

For full documentation visit mkdocs.org.

"},{"location":"#commands","title":"Commands","text":"
  • mkdocs new [dir-name] - Create a new project.
  • mkdocs serve - Start the live-reloading docs server.
  • mkdocs build - Build the documentation site.
  • mkdocs -h - Print help message and exit.
"},{"location":"#project-layout","title":"Project layout","text":"
mkdocs.yml    # The configuration file.\ndocs/\n    index.md  # The documentation homepage.\n    ...       # Other markdown pages, images and other files.\n
"},{"location":"#omnipy.api.enums.ConfigPersistOutputsOptions","title":"ConfigPersistOutputsOptions","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class ConfigPersistOutputsOptions(str, Enum):\n\"\"\"\"\"\"\n    DISABLED = 'disabled'\n    ENABLE_FLOW_OUTPUTS = 'flow'\n    ENABLE_FLOW_AND_TASK_OUTPUTS = 'all'\n
"},{"location":"#omnipy.api.enums.ConfigPersistOutputsOptions.DISABLED","title":"DISABLED = 'disabled' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.ConfigPersistOutputsOptions.ENABLE_FLOW_AND_TASK_OUTPUTS","title":"ENABLE_FLOW_AND_TASK_OUTPUTS = 'all' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.ConfigPersistOutputsOptions.ENABLE_FLOW_OUTPUTS","title":"ENABLE_FLOW_OUTPUTS = 'flow' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.ConfigRestoreOutputsOptions","title":"ConfigRestoreOutputsOptions","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class ConfigRestoreOutputsOptions(str, Enum):\n\"\"\"\"\"\"\n    DISABLED = 'disabled'\n    AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params'\n
"},{"location":"#omnipy.api.enums.ConfigRestoreOutputsOptions.AUTO_ENABLE_IGNORE_PARAMS","title":"AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.ConfigRestoreOutputsOptions.DISABLED","title":"DISABLED = 'disabled' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.EngineChoice","title":"EngineChoice","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class EngineChoice(str, Enum):\n\"\"\"\"\"\"\n    LOCAL = 'local'\n    PREFECT = 'prefect'\n
"},{"location":"#omnipy.api.enums.EngineChoice.LOCAL","title":"LOCAL = 'local' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.EngineChoice.PREFECT","title":"PREFECT = 'prefect' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.PersistOutputsOptions","title":"PersistOutputsOptions","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class PersistOutputsOptions(str, Enum):\n\"\"\"\"\"\"\n    DISABLED = 'disabled'\n    FOLLOW_CONFIG = 'config'\n    ENABLED = 'enabled'\n
"},{"location":"#omnipy.api.enums.PersistOutputsOptions.DISABLED","title":"DISABLED = 'disabled' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.PersistOutputsOptions.ENABLED","title":"ENABLED = 'enabled' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.PersistOutputsOptions.FOLLOW_CONFIG","title":"FOLLOW_CONFIG = 'config' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RestoreOutputsOptions","title":"RestoreOutputsOptions","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class RestoreOutputsOptions(str, Enum):\n\"\"\"\"\"\"\n    DISABLED = 'disabled'\n    FOLLOW_CONFIG = 'config'\n    AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params'\n    FORCE_ENABLE_IGNORE_PARAMS = 'force_ignore_params'\n
"},{"location":"#omnipy.api.enums.RestoreOutputsOptions.AUTO_ENABLE_IGNORE_PARAMS","title":"AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RestoreOutputsOptions.DISABLED","title":"DISABLED = 'disabled' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RestoreOutputsOptions.FOLLOW_CONFIG","title":"FOLLOW_CONFIG = 'config' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RestoreOutputsOptions.FORCE_ENABLE_IGNORE_PARAMS","title":"FORCE_ENABLE_IGNORE_PARAMS = 'force_ignore_params' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RunState","title":"RunState","text":"

Bases: IntEnum

Source code in src/omnipy/api/enums.py
class RunState(IntEnum):\n\"\"\"\"\"\"\n    INITIALIZED = 1\n    RUNNING = 2\n    FINISHED = 3\n
"},{"location":"#omnipy.api.enums.RunState.FINISHED","title":"FINISHED = 3 instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RunState.INITIALIZED","title":"INITIALIZED = 1 instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RunState.RUNNING","title":"RUNNING = 2 instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RunStateLogMessages","title":"RunStateLogMessages","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class RunStateLogMessages(str, Enum):\n\"\"\"\"\"\"\n    INITIALIZED = 'Initialized \"{}\"'\n    RUNNING = 'Started running \"{}\"...'\n    FINISHED = 'Finished running \"{}\"!'\n
"},{"location":"#omnipy.api.enums.RunStateLogMessages.FINISHED","title":"FINISHED = 'Finished running \"{}\"!' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RunStateLogMessages.INITIALIZED","title":"INITIALIZED = 'Initialized \"{}\"' instance-attribute class-attribute","text":""},{"location":"#omnipy.api.enums.RunStateLogMessages.RUNNING","title":"RUNNING = 'Started running \"{}\"...' instance-attribute class-attribute","text":""},{"location":"reference/SUMMARY/","title":"SUMMARY","text":"
  • omnipy
    • api
      • enums
      • exceptions
      • protocols
        • private
          • compute
            • job
            • job_creator
            • mixins
          • config
          • engine
          • log
          • util
        • public
          • compute
          • config
          • engine
          • hub
      • types
    • compute
      • flow
      • func_job
      • job
      • job_creator
      • mixins
        • flow_context
        • func_signature
        • iterate
        • mixin_types
        • name
        • params
        • result_key
        • serialize
      • task
      • tasklist_job
      • typing
    • config
      • engine
      • job
      • root_log
    • data
      • dataset
      • model
      • serializer
    • engine
      • base
      • job_runner
      • local
    • hub
      • entry
      • root_log
      • runtime
    • log
      • constants
      • mixin
      • registry
    • modules
      • fairtracks
        • create_filter
        • functions
        • get_from_filter
        • tasks
      • general
        • models
        • tasks
      • json
        • datasets
        • flows
        • functions
        • models
        • serializers
        • tasks
        • types
      • pandas
        • models
        • serializers
        • tasks
      • prefect
        • engine
          • prefect
      • raw
        • protocols
        • serializers
        • tasks
      • tables
        • models
        • tasks
    • util
      • callable_decorator_cls
      • dataframe
      • helpers
      • mixin
      • param_key_mapper
      • publisher
"},{"location":"reference/omnipy/","title":"omnipy","text":""},{"location":"reference/omnipy/#omnipy.ROOT_DIR","title":"ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) module-attribute","text":""},{"location":"reference/omnipy/#omnipy.__version__","title":"__version__ = '0.10.4' module-attribute","text":""},{"location":"reference/omnipy/#omnipy.runtime","title":"runtime: Optional[Runtime] = _get_runtime() module-attribute","text":""},{"location":"reference/omnipy/api/","title":"api","text":""},{"location":"reference/omnipy/api/enums/","title":"enums","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.ConfigPersistOutputsOptions","title":"ConfigPersistOutputsOptions","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class ConfigPersistOutputsOptions(str, Enum):\n\"\"\"\"\"\"\n    DISABLED = 'disabled'\n    ENABLE_FLOW_OUTPUTS = 'flow'\n    ENABLE_FLOW_AND_TASK_OUTPUTS = 'all'\n
"},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.ConfigPersistOutputsOptions.DISABLED","title":"DISABLED = 'disabled' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.ConfigPersistOutputsOptions.ENABLE_FLOW_AND_TASK_OUTPUTS","title":"ENABLE_FLOW_AND_TASK_OUTPUTS = 'all' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.ConfigPersistOutputsOptions.ENABLE_FLOW_OUTPUTS","title":"ENABLE_FLOW_OUTPUTS = 'flow' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.ConfigRestoreOutputsOptions","title":"ConfigRestoreOutputsOptions","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class ConfigRestoreOutputsOptions(str, Enum):\n\"\"\"\"\"\"\n    DISABLED = 'disabled'\n    AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params'\n
"},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.ConfigRestoreOutputsOptions.AUTO_ENABLE_IGNORE_PARAMS","title":"AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.ConfigRestoreOutputsOptions.DISABLED","title":"DISABLED = 'disabled' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.EngineChoice","title":"EngineChoice","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class EngineChoice(str, Enum):\n\"\"\"\"\"\"\n    LOCAL = 'local'\n    PREFECT = 'prefect'\n
"},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.EngineChoice.LOCAL","title":"LOCAL = 'local' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.EngineChoice.PREFECT","title":"PREFECT = 'prefect' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.PersistOutputsOptions","title":"PersistOutputsOptions","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class PersistOutputsOptions(str, Enum):\n\"\"\"\"\"\"\n    DISABLED = 'disabled'\n    FOLLOW_CONFIG = 'config'\n    ENABLED = 'enabled'\n
"},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.PersistOutputsOptions.DISABLED","title":"DISABLED = 'disabled' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.PersistOutputsOptions.ENABLED","title":"ENABLED = 'enabled' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.PersistOutputsOptions.FOLLOW_CONFIG","title":"FOLLOW_CONFIG = 'config' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RestoreOutputsOptions","title":"RestoreOutputsOptions","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class RestoreOutputsOptions(str, Enum):\n\"\"\"\"\"\"\n    DISABLED = 'disabled'\n    FOLLOW_CONFIG = 'config'\n    AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params'\n    FORCE_ENABLE_IGNORE_PARAMS = 'force_ignore_params'\n
"},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RestoreOutputsOptions.AUTO_ENABLE_IGNORE_PARAMS","title":"AUTO_ENABLE_IGNORE_PARAMS = 'auto_ignore_params' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RestoreOutputsOptions.DISABLED","title":"DISABLED = 'disabled' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RestoreOutputsOptions.FOLLOW_CONFIG","title":"FOLLOW_CONFIG = 'config' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RestoreOutputsOptions.FORCE_ENABLE_IGNORE_PARAMS","title":"FORCE_ENABLE_IGNORE_PARAMS = 'force_ignore_params' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RunState","title":"RunState","text":"

Bases: IntEnum

Source code in src/omnipy/api/enums.py
class RunState(IntEnum):\n\"\"\"\"\"\"\n    INITIALIZED = 1\n    RUNNING = 2\n    FINISHED = 3\n
"},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RunState.FINISHED","title":"FINISHED = 3 instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RunState.INITIALIZED","title":"INITIALIZED = 1 instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RunState.RUNNING","title":"RUNNING = 2 instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RunStateLogMessages","title":"RunStateLogMessages","text":"

Bases: str, Enum

Source code in src/omnipy/api/enums.py
class RunStateLogMessages(str, Enum):\n\"\"\"\"\"\"\n    INITIALIZED = 'Initialized \"{}\"'\n    RUNNING = 'Started running \"{}\"...'\n    FINISHED = 'Finished running \"{}\"!'\n
"},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RunStateLogMessages.FINISHED","title":"FINISHED = 'Finished running \"{}\"!' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RunStateLogMessages.INITIALIZED","title":"INITIALIZED = 'Initialized \"{}\"' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/enums/#omnipy.api.enums.RunStateLogMessages.RUNNING","title":"RUNNING = 'Started running \"{}\"...' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/exceptions/","title":"exceptions","text":""},{"location":"reference/omnipy/api/exceptions/#omnipy.api.exceptions.JobStateException","title":"JobStateException","text":"

Bases: Exception

Source code in src/omnipy/api/exceptions.py
class JobStateException(Exception):\n    ...\n
"},{"location":"reference/omnipy/api/types/","title":"types","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.DecoratorClassT","title":"DecoratorClassT = TypeVar('DecoratorClassT', covariant=True) module-attribute","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.GeneralDecorator","title":"GeneralDecorator = Callable[[Callable], Callable] module-attribute","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.JobConfigT","title":"JobConfigT = TypeVar('JobConfigT', covariant=True) module-attribute","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.JobT","title":"JobT = TypeVar('JobT', covariant=True) module-attribute","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.JobTemplateT","title":"JobTemplateT = TypeVar('JobTemplateT', covariant=True) module-attribute","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.LocaleType","title":"LocaleType: TypeAlias = Union[str, Tuple[Optional[str], Optional[str]]] module-attribute","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.TaskTemplateContraT","title":"TaskTemplateContraT = TypeVar('TaskTemplateContraT', contravariant=True) module-attribute","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.TaskTemplateCovT","title":"TaskTemplateCovT = TypeVar('TaskTemplateCovT', covariant=True) module-attribute","text":""},{"location":"reference/omnipy/api/types/#omnipy.api.types.TaskTemplateT","title":"TaskTemplateT = TypeVar('TaskTemplateT') module-attribute","text":""},{"location":"reference/omnipy/api/protocols/","title":"protocols","text":""},{"location":"reference/omnipy/api/protocols/private/","title":"private","text":""},{"location":"reference/omnipy/api/protocols/private/config/","title":"config","text":""},{"location":"reference/omnipy/api/protocols/private/config/#omnipy.api.protocols.private.config.IsJobConfigBase","title":"IsJobConfigBase","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/config.py
class IsJobConfigBase(Protocol):\n\"\"\"\"\"\"\n    persist_outputs: ConfigPersistOutputsOptions\n    restore_outputs: ConfigRestoreOutputsOptions\n    persist_data_dir_path: str\n
"},{"location":"reference/omnipy/api/protocols/private/config/#omnipy.api.protocols.private.config.IsJobConfigBase.persist_data_dir_path","title":"persist_data_dir_path: str instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/private/config/#omnipy.api.protocols.private.config.IsJobConfigBase.persist_outputs","title":"persist_outputs: ConfigPersistOutputsOptions instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/private/config/#omnipy.api.protocols.private.config.IsJobConfigBase.restore_outputs","title":"restore_outputs: ConfigRestoreOutputsOptions instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/private/engine/","title":"engine","text":""},{"location":"reference/omnipy/api/protocols/private/engine/#omnipy.api.protocols.private.engine.IsEngine","title":"IsEngine","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/engine.py
@runtime_checkable\nclass IsEngine(Protocol):\n\"\"\"\"\"\"\n    def __init__(self) -> None:\n        ...\n\n    @classmethod\n    def get_config_cls(cls) -> Type[IsEngineConfig]:\n        ...\n\n    def set_config(self, config: IsEngineConfig) -> None:\n        ...\n\n    def set_registry(self, registry: Optional[IsRunStateRegistry]) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/engine/#omnipy.api.protocols.private.engine.IsEngine.__init__","title":"__init__()","text":"Source code in src/omnipy/api/protocols/private/engine.py
def __init__(self) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/engine/#omnipy.api.protocols.private.engine.IsEngine.get_config_cls","title":"get_config_cls() classmethod","text":"Source code in src/omnipy/api/protocols/private/engine.py
@classmethod\ndef get_config_cls(cls) -> Type[IsEngineConfig]:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/engine/#omnipy.api.protocols.private.engine.IsEngine.set_config","title":"set_config(config)","text":"Source code in src/omnipy/api/protocols/private/engine.py
def set_config(self, config: IsEngineConfig) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/engine/#omnipy.api.protocols.private.engine.IsEngine.set_registry","title":"set_registry(registry)","text":"Source code in src/omnipy/api/protocols/private/engine.py
def set_registry(self, registry: Optional[IsRunStateRegistry]) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/engine/#omnipy.api.protocols.private.engine.IsEngineConfig","title":"IsEngineConfig","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/engine.py
class IsEngineConfig(Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/log/","title":"log","text":""},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.CanLog","title":"CanLog","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/log.py
class CanLog(Protocol):\n\"\"\"\"\"\"\n    @property\n    def logger(self) -> Logger:\n        ...\n\n    def log(self, log_msg: str, level: int = INFO, datetime_obj: Optional[datetime] = None):\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.CanLog.logger","title":"logger: Logger property","text":""},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.CanLog.log","title":"log(log_msg, level=INFO, datetime_obj=None)","text":"Source code in src/omnipy/api/protocols/private/log.py
def log(self, log_msg: str, level: int = INFO, datetime_obj: Optional[datetime] = None):\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.IsRunStateRegistry","title":"IsRunStateRegistry","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/log.py
class IsRunStateRegistry(Protocol):\n\"\"\"\"\"\"\n    def __init__(self) -> None:\n        ...\n\n    def get_job_state(self, job: IsUniquelyNamedJob) -> RunState:\n        ...\n\n    def get_job_state_datetime(self, job: IsUniquelyNamedJob, state: RunState) -> datetime:\n        ...\n\n    def all_jobs(self, state: Optional[RunState] = None) -> Tuple[IsUniquelyNamedJob, ...]:  # noqa\n        ...\n\n    def set_job_state(self, job: IsUniquelyNamedJob, state: RunState) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.IsRunStateRegistry.__init__","title":"__init__()","text":"Source code in src/omnipy/api/protocols/private/log.py
def __init__(self) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.IsRunStateRegistry.all_jobs","title":"all_jobs(state=None)","text":"Source code in src/omnipy/api/protocols/private/log.py
def all_jobs(self, state: Optional[RunState] = None) -> Tuple[IsUniquelyNamedJob, ...]:  # noqa\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.IsRunStateRegistry.get_job_state","title":"get_job_state(job)","text":"Source code in src/omnipy/api/protocols/private/log.py
def get_job_state(self, job: IsUniquelyNamedJob) -> RunState:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.IsRunStateRegistry.get_job_state_datetime","title":"get_job_state_datetime(job, state)","text":"Source code in src/omnipy/api/protocols/private/log.py
def get_job_state_datetime(self, job: IsUniquelyNamedJob, state: RunState) -> datetime:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/log/#omnipy.api.protocols.private.log.IsRunStateRegistry.set_job_state","title":"set_job_state(job, state)","text":"Source code in src/omnipy/api/protocols/private/log.py
def set_job_state(self, job: IsUniquelyNamedJob, state: RunState) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/util/","title":"util","text":""},{"location":"reference/omnipy/api/protocols/private/util/#omnipy.api.protocols.private.util.IsCallableClass","title":"IsCallableClass","text":"

Bases: Protocol[DecoratorClassT]

Source code in src/omnipy/api/protocols/private/util.py
@runtime_checkable\nclass IsCallableClass(Protocol[DecoratorClassT]):\n\"\"\"\"\"\"\n    def __call__(self, *args: object, **kwargs: object) -> Callable[[Callable], DecoratorClassT]:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/util/#omnipy.api.protocols.private.util.IsCallableClass.__call__","title":"__call__(*args, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/util.py
def __call__(self, *args: object, **kwargs: object) -> Callable[[Callable], DecoratorClassT]:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/util/#omnipy.api.protocols.private.util.IsCallableParamAfterSelf","title":"IsCallableParamAfterSelf","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/util.py
@runtime_checkable\nclass IsCallableParamAfterSelf(Protocol):\n\"\"\"\"\"\"\n    def __call__(self, callable_arg: Callable, /, *args: object, **kwargs: object) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/util/#omnipy.api.protocols.private.util.IsCallableParamAfterSelf.__call__","title":"__call__(callable_arg, /, *args, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/util.py
def __call__(self, callable_arg: Callable, /, *args: object, **kwargs: object) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/","title":"compute","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/","title":"job","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJob","title":"IsFuncArgJob","text":"

Bases: IsFuncArgJobBase, Protocol[JobT]

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsFuncArgJob(IsFuncArgJobBase, Protocol[JobT]):\n\"\"\"\"\"\"\n    def revise(self) -> JobT:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJob.revise","title":"revise()","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def revise(self) -> JobT:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase","title":"IsFuncArgJobBase","text":"

Bases: IsJob, Protocol

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsFuncArgJobBase(IsJob, Protocol):\n\"\"\"\"\"\"\n    @property\n    def param_signatures(self) -> MappingProxyType:\n        ...\n\n    @property\n    def return_type(self) -> Type[object]:\n        ...\n\n    @property\n    def iterate_over_data_files(self) -> bool:\n        ...\n\n    @property\n    def persist_outputs(self) -> Optional[PersistOutputsOptions]:\n        ...\n\n    @property\n    def restore_outputs(self) -> Optional[RestoreOutputsOptions]:\n        ...\n\n    @property\n    def will_persist_outputs(self) -> PersistOutputsOptions:\n        ...\n\n    @property\n    def will_restore_outputs(self) -> RestoreOutputsOptions:\n        ...\n\n    @property\n    def result_key(self) -> Optional[str]:\n        ...\n\n    @property\n    def fixed_params(self) -> MappingProxyType[str, object]:\n        ...\n\n    @property\n    def param_key_map(self) -> MappingProxyType[str, str]:\n        ...\n\n    def has_coroutine_func(self) -> bool:\n        ...\n\n    def get_call_args(self, *args: object, **kwargs: object) -> Dict[str, object]:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.fixed_params","title":"fixed_params: MappingProxyType[str, object] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.iterate_over_data_files","title":"iterate_over_data_files: bool property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.param_key_map","title":"param_key_map: MappingProxyType[str, str] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.param_signatures","title":"param_signatures: MappingProxyType property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.persist_outputs","title":"persist_outputs: Optional[PersistOutputsOptions] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.restore_outputs","title":"restore_outputs: Optional[RestoreOutputsOptions] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.result_key","title":"result_key: Optional[str] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.return_type","title":"return_type: Type[object] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.will_persist_outputs","title":"will_persist_outputs: PersistOutputsOptions property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.will_restore_outputs","title":"will_restore_outputs: RestoreOutputsOptions property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.get_call_args","title":"get_call_args(*args, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def get_call_args(self, *args: object, **kwargs: object) -> Dict[str, object]:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobBase.has_coroutine_func","title":"has_coroutine_func()","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def has_coroutine_func(self) -> bool:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplate","title":"IsFuncArgJobTemplate","text":"

Bases: IsJobTemplate, IsFuncArgJobBase, Protocol[JobTemplateT, JobT]

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsFuncArgJobTemplate(IsJobTemplate, IsFuncArgJobBase, Protocol[JobTemplateT, JobT]):\n\"\"\"\"\"\"\n    def refine(self,\n               *args: Any,\n               update: bool = True,\n               name: Optional[str] = None,\n               iterate_over_data_files: bool = False,\n               persist_outputs: Optional[PersistOutputsOptions] = None,\n               restore_outputs: Optional[RestoreOutputsOptions] = None,\n               result_key: Optional[str] = None,\n               fixed_params: Optional[Mapping[str, object]] = None,\n               param_key_map: Optional[Mapping[str, str]] = None,\n               **kwargs: object) -> JobTemplateT:\n        ...\n\n    def apply(self) -> JobT:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplate.apply","title":"apply()","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def apply(self) -> JobT:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplate.refine","title":"refine(*args, update=True, name=None, iterate_over_data_files=False, persist_outputs=None, restore_outputs=None, result_key=None, fixed_params=None, param_key_map=None, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def refine(self,\n           *args: Any,\n           update: bool = True,\n           name: Optional[str] = None,\n           iterate_over_data_files: bool = False,\n           persist_outputs: Optional[PersistOutputsOptions] = None,\n           restore_outputs: Optional[RestoreOutputsOptions] = None,\n           result_key: Optional[str] = None,\n           fixed_params: Optional[Mapping[str, object]] = None,\n           param_key_map: Optional[Mapping[str, str]] = None,\n           **kwargs: object) -> JobTemplateT:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplateCallable","title":"IsFuncArgJobTemplateCallable","text":"

Bases: Protocol[JobTemplateT]

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsFuncArgJobTemplateCallable(Protocol[JobTemplateT]):\n\"\"\"\"\"\"\n    def __call__(\n        self,\n        name: Optional[str] = None,\n        iterate_over_data_files: bool = False,\n        persist_outputs: Optional[PersistOutputsOptions] = None,\n        restore_outputs: Optional[RestoreOutputsOptions] = None,\n        result_key: Optional[str] = None,\n        fixed_params: Optional[Mapping[str, object]] = None,\n        param_key_map: Optional[Mapping[str, str]] = None,\n        **kwargs: object,\n    ) -> Callable[[Callable], JobTemplateT]:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplateCallable.__call__","title":"__call__(name=None, iterate_over_data_files=False, persist_outputs=None, restore_outputs=None, result_key=None, fixed_params=None, param_key_map=None, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def __call__(\n    self,\n    name: Optional[str] = None,\n    iterate_over_data_files: bool = False,\n    persist_outputs: Optional[PersistOutputsOptions] = None,\n    restore_outputs: Optional[RestoreOutputsOptions] = None,\n    result_key: Optional[str] = None,\n    fixed_params: Optional[Mapping[str, object]] = None,\n    param_key_map: Optional[Mapping[str, str]] = None,\n    **kwargs: object,\n) -> Callable[[Callable], JobTemplateT]:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJob","title":"IsJob","text":"

Bases: IsJobBase, Protocol

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsJob(IsJobBase, Protocol):\n\"\"\"\"\"\"\n    @property\n    def time_of_cur_toplevel_flow_run(self) -> Optional[datetime]:\n        ...\n\n    @classmethod\n    def create_job(cls, *args: object, **kwargs: object) -> IsJob:\n        ...\n\n    def __call__(self, *args: object, **kwargs: object) -> object:\n        ...\n\n    def _apply_engine_decorator(self, engine: IsEngine) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJob.time_of_cur_toplevel_flow_run","title":"time_of_cur_toplevel_flow_run: Optional[datetime] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJob.__call__","title":"__call__(*args, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def __call__(self, *args: object, **kwargs: object) -> object:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJob.create_job","title":"create_job(*args, **kwargs) classmethod","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
@classmethod\ndef create_job(cls, *args: object, **kwargs: object) -> IsJob:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJobBase","title":"IsJobBase","text":"

Bases: CanLog, IsUniquelyNamedJob, Protocol

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsJobBase(CanLog, IsUniquelyNamedJob, Protocol):\n\"\"\"\"\"\"\n    @property\n    def _job_creator(self) -> IsJobCreator:\n        ...\n\n    @property\n    def config(self) -> Optional[IsJobConfigBase]:\n        ...\n\n    @property\n    def engine(self) -> Optional[IsEngine]:\n        ...\n\n    @property\n    def in_flow_context(self) -> bool:\n        ...\n\n    def __eq__(self, other: object):\n        ...\n\n    @classmethod\n    def _create_job_template(cls, *args: object, **kwargs: object) -> IsJobTemplate:\n        ...\n\n    @classmethod\n    def _create_job(cls, *args: object, **kwargs: object) -> IsJob:\n        ...\n\n    def _apply(self) -> IsJob:\n        ...\n\n    def _refine(self, *args: Any, update: bool = True, **kwargs: object) -> IsJobTemplate:\n        ...\n\n    def _revise(self) -> IsJobTemplate:\n        ...\n\n    def _call_job_template(self, *args: object, **kwargs: object) -> object:\n        ...\n\n    def _call_job(self, *args: object, **kwargs: object) -> object:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJobBase.config","title":"config: Optional[IsJobConfigBase] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJobBase.engine","title":"engine: Optional[IsEngine] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJobBase.in_flow_context","title":"in_flow_context: bool property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJobBase.__eq__","title":"__eq__(other)","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def __eq__(self, other: object):\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJobTemplate","title":"IsJobTemplate","text":"

Bases: IsJobBase, Protocol

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsJobTemplate(IsJobBase, Protocol):\n\"\"\"\"\"\"\n    @classmethod\n    def create_job_template(cls, *args: object, **kwargs: object) -> IsJobTemplate:\n        ...\n\n    def run(self, *args: object, **kwargs: object) -> object:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJobTemplate.create_job_template","title":"create_job_template(*args, **kwargs) classmethod","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
@classmethod\ndef create_job_template(cls, *args: object, **kwargs: object) -> IsJobTemplate:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsJobTemplate.run","title":"run(*args, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def run(self, *args: object, **kwargs: object) -> object:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsPlainFuncArgJobBase","title":"IsPlainFuncArgJobBase","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsPlainFuncArgJobBase(Protocol):\n\"\"\"\"\"\"\n    _job_func: Callable\n\n    def _accept_call_func_decorator(self, call_func_decorator: GeneralDecorator) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJob","title":"IsTaskTemplateArgsJob","text":"

Bases: IsTaskTemplateArgsJobBase[TaskTemplateCovT], IsFuncArgJob[JobT], Protocol[TaskTemplateCovT, JobT]

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsTaskTemplateArgsJob(IsTaskTemplateArgsJobBase[TaskTemplateCovT],\n                            IsFuncArgJob[JobT],\n                            Protocol[TaskTemplateCovT, JobT]):\n\"\"\"\"\"\"\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobBase","title":"IsTaskTemplateArgsJobBase","text":"

Bases: IsFuncArgJobBase, Protocol[TaskTemplateCovT]

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsTaskTemplateArgsJobBase(IsFuncArgJobBase, Protocol[TaskTemplateCovT]):\n\"\"\"\"\"\"\n    @property\n    def task_templates(self) -> Tuple[TaskTemplateCovT, ...]:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobBase.task_templates","title":"task_templates: Tuple[TaskTemplateCovT, ...] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobTemplate","title":"IsTaskTemplateArgsJobTemplate","text":"

Bases: IsFuncArgJobTemplate[JobTemplateT, JobT], IsTaskTemplateArgsJobBase[TaskTemplateT], Protocol[TaskTemplateT, JobTemplateT, JobT]

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsTaskTemplateArgsJobTemplate(IsFuncArgJobTemplate[JobTemplateT, JobT],\n                                    IsTaskTemplateArgsJobBase[TaskTemplateT],\n                                    Protocol[TaskTemplateT, JobTemplateT, JobT]):\n\"\"\"\"\"\"\n    def refine(self,\n               *task_templates: TaskTemplateT,\n               update: bool = True,\n               name: Optional[str] = None,\n               iterate_over_data_files: bool = False,\n               fixed_params: Optional[Mapping[str, object]] = None,\n               param_key_map: Optional[Mapping[str, str]] = None,\n               result_key: Optional[str] = None,\n               persist_outputs: Optional[PersistOutputsOptions] = None,\n               restore_outputs: Optional[RestoreOutputsOptions] = None,\n               **kwargs: object) -> JobTemplateT:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobTemplate.refine","title":"refine(*task_templates, update=True, name=None, iterate_over_data_files=False, fixed_params=None, param_key_map=None, result_key=None, persist_outputs=None, restore_outputs=None, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def refine(self,\n           *task_templates: TaskTemplateT,\n           update: bool = True,\n           name: Optional[str] = None,\n           iterate_over_data_files: bool = False,\n           fixed_params: Optional[Mapping[str, object]] = None,\n           param_key_map: Optional[Mapping[str, str]] = None,\n           result_key: Optional[str] = None,\n           persist_outputs: Optional[PersistOutputsOptions] = None,\n           restore_outputs: Optional[RestoreOutputsOptions] = None,\n           **kwargs: object) -> JobTemplateT:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobTemplateCallable","title":"IsTaskTemplateArgsJobTemplateCallable","text":"

Bases: Protocol[TaskTemplateContraT, JobTemplateT]

Source code in src/omnipy/api/protocols/private/compute/job.py
class IsTaskTemplateArgsJobTemplateCallable(Protocol[TaskTemplateContraT, JobTemplateT]):\n\"\"\"\"\"\"\n    def __call__(\n        self,\n        *task_templates: TaskTemplateContraT,\n        name: Optional[str] = None,\n        iterate_over_data_files: bool = False,\n        persist_outputs: Optional[PersistOutputsOptions] = None,\n        restore_outputs: Optional[RestoreOutputsOptions] = None,\n        result_key: Optional[str] = None,\n        fixed_params: Optional[Mapping[str, object]] = None,\n        param_key_map: Optional[Mapping[str, str]] = None,\n        **kwargs: object,\n    ) -> Callable[[Callable], JobTemplateT]:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job/#omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobTemplateCallable.__call__","title":"__call__(*task_templates, name=None, iterate_over_data_files=False, persist_outputs=None, restore_outputs=None, result_key=None, fixed_params=None, param_key_map=None, **kwargs)","text":"Source code in src/omnipy/api/protocols/private/compute/job.py
def __call__(\n    self,\n    *task_templates: TaskTemplateContraT,\n    name: Optional[str] = None,\n    iterate_over_data_files: bool = False,\n    persist_outputs: Optional[PersistOutputsOptions] = None,\n    restore_outputs: Optional[RestoreOutputsOptions] = None,\n    result_key: Optional[str] = None,\n    fixed_params: Optional[Mapping[str, object]] = None,\n    param_key_map: Optional[Mapping[str, str]] = None,\n    **kwargs: object,\n) -> Callable[[Callable], JobTemplateT]:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/","title":"job_creator","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/#omnipy.api.protocols.private.compute.job_creator.IsJobConfigHolder","title":"IsJobConfigHolder","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/compute/job_creator.py
class IsJobConfigHolder(Protocol):\n\"\"\"\"\"\"\n    @property\n    def config(self) -> Optional[IsJobConfigBase]:\n        ...\n\n    @property\n    def engine(self) -> Optional[IsEngine]:\n        ...\n\n    def set_config(self, config: IsJobConfigBase) -> None:\n        ...\n\n    def set_engine(self, engine: IsEngine) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/#omnipy.api.protocols.private.compute.job_creator.IsJobConfigHolder.config","title":"config: Optional[IsJobConfigBase] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/#omnipy.api.protocols.private.compute.job_creator.IsJobConfigHolder.engine","title":"engine: Optional[IsEngine] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/#omnipy.api.protocols.private.compute.job_creator.IsJobConfigHolder.set_config","title":"set_config(config)","text":"Source code in src/omnipy/api/protocols/private/compute/job_creator.py
def set_config(self, config: IsJobConfigBase) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/#omnipy.api.protocols.private.compute.job_creator.IsJobConfigHolder.set_engine","title":"set_engine(engine)","text":"Source code in src/omnipy/api/protocols/private/compute/job_creator.py
def set_engine(self, engine: IsEngine) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/#omnipy.api.protocols.private.compute.job_creator.IsJobCreator","title":"IsJobCreator","text":"

Bases: IsNestedContext, IsJobConfigHolder, Protocol

Source code in src/omnipy/api/protocols/private/compute/job_creator.py
class IsJobCreator(IsNestedContext, IsJobConfigHolder, Protocol):\n\"\"\"\"\"\"\n    @property\n    def nested_context_level(self) -> int:\n        ...\n\n    @property\n    def time_of_cur_toplevel_nested_context_run(self) -> Optional[datetime]:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/#omnipy.api.protocols.private.compute.job_creator.IsJobCreator.nested_context_level","title":"nested_context_level: int property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/job_creator/#omnipy.api.protocols.private.compute.job_creator.IsJobCreator.time_of_cur_toplevel_nested_context_run","title":"time_of_cur_toplevel_nested_context_run: Optional[datetime] property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/mixins/","title":"mixins","text":""},{"location":"reference/omnipy/api/protocols/private/compute/mixins/#omnipy.api.protocols.private.compute.mixins.IsNestedContext","title":"IsNestedContext","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/compute/mixins.py
class IsNestedContext(Protocol):\n\"\"\"\"\"\"\n    def __enter__(self):\n        ...\n\n    def __exit__(self, exc_type, exc_value, traceback):\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/mixins/#omnipy.api.protocols.private.compute.mixins.IsNestedContext.__enter__","title":"__enter__()","text":"Source code in src/omnipy/api/protocols/private/compute/mixins.py
def __enter__(self):\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/mixins/#omnipy.api.protocols.private.compute.mixins.IsNestedContext.__exit__","title":"__exit__(exc_type, exc_value, traceback)","text":"Source code in src/omnipy/api/protocols/private/compute/mixins.py
def __exit__(self, exc_type, exc_value, traceback):\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/mixins/#omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob","title":"IsUniquelyNamedJob","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/private/compute/mixins.py
class IsUniquelyNamedJob(Protocol):\n\"\"\"\"\"\"\n    @property\n    def name(self) -> str:\n        ...\n\n    @property\n    def unique_name(self) -> str:\n        ...\n\n    def __init__(self, *, name: Optional[str] = None):\n        ...\n\n    def regenerate_unique_name(self) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/mixins/#omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob.name","title":"name: str property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/mixins/#omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob.unique_name","title":"unique_name: str property","text":""},{"location":"reference/omnipy/api/protocols/private/compute/mixins/#omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob.__init__","title":"__init__(*, name=None)","text":"Source code in src/omnipy/api/protocols/private/compute/mixins.py
def __init__(self, *, name: Optional[str] = None):\n    ...\n
"},{"location":"reference/omnipy/api/protocols/private/compute/mixins/#omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob.regenerate_unique_name","title":"regenerate_unique_name()","text":"Source code in src/omnipy/api/protocols/private/compute/mixins.py
def regenerate_unique_name(self) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/","title":"public","text":""},{"location":"reference/omnipy/api/protocols/public/compute/","title":"compute","text":""},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsDagFlow","title":"IsDagFlow","text":"

Bases: IsTaskTemplateArgsJob[IsTaskTemplate, IsDagFlowTemplate], IsFlow, Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsDagFlow(IsTaskTemplateArgsJob[IsTaskTemplate, IsDagFlowTemplate], IsFlow, Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsDagFlowTemplate","title":"IsDagFlowTemplate","text":"

Bases: IsTaskTemplateArgsJobTemplate[IsTaskTemplate, IsDagFlowTemplate, IsDagFlow], IsFlowTemplate, Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsDagFlowTemplate(IsTaskTemplateArgsJobTemplate[IsTaskTemplate,\n                                                      'IsDagFlowTemplate',\n                                                      'IsDagFlow'],\n                        IsFlowTemplate,\n                        Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsFlow","title":"IsFlow","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsFlow(Protocol):\n\"\"\"\"\"\"\n    @property\n    def flow_context(self) -> IsNestedContext:\n        ...\n\n    @property\n    def time_of_last_run(self) -> Optional[datetime]:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsFlow.flow_context","title":"flow_context: IsNestedContext property","text":""},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsFlow.time_of_last_run","title":"time_of_last_run: Optional[datetime] property","text":""},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsFlowTemplate","title":"IsFlowTemplate","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsFlowTemplate(Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsFuncFlow","title":"IsFuncFlow","text":"

Bases: IsFuncArgJob[IsFuncFlowTemplate], Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsFuncFlow(IsFuncArgJob[IsFuncFlowTemplate], Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsFuncFlowTemplate","title":"IsFuncFlowTemplate","text":"

Bases: IsFuncArgJobTemplate[IsFuncFlowTemplate, IsFuncFlow], IsFlowTemplate, Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsFuncFlowTemplate(IsFuncArgJobTemplate['IsFuncFlowTemplate', 'IsFuncFlow'],\n                         IsFlowTemplate,\n                         Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsLinearFlow","title":"IsLinearFlow","text":"

Bases: IsTaskTemplateArgsJob[IsTaskTemplate, IsLinearFlowTemplate], IsFlow, Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsLinearFlow(IsTaskTemplateArgsJob[IsTaskTemplate, IsLinearFlowTemplate], IsFlow, Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsLinearFlowTemplate","title":"IsLinearFlowTemplate","text":"

Bases: IsTaskTemplateArgsJobTemplate[IsTaskTemplate, IsLinearFlowTemplate, IsLinearFlow], IsFlowTemplate, Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsLinearFlowTemplate(IsTaskTemplateArgsJobTemplate[IsTaskTemplate,\n                                                         'IsLinearFlowTemplate',\n                                                         'IsLinearFlow'],\n                           IsFlowTemplate,\n                           Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsTask","title":"IsTask","text":"

Bases: IsFuncArgJob[IsTaskTemplate], Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsTask(IsFuncArgJob[IsTaskTemplate], Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/compute/#omnipy.api.protocols.public.compute.IsTaskTemplate","title":"IsTaskTemplate","text":"

Bases: IsFuncArgJobTemplate[IsTaskTemplate, IsTask], Protocol

Source code in src/omnipy/api/protocols/public/compute.py
class IsTaskTemplate(IsFuncArgJobTemplate['IsTaskTemplate', 'IsTask'], Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/config/","title":"config","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsJobConfig","title":"IsJobConfig","text":"

Bases: IsJobConfigBase, Protocol

Source code in src/omnipy/api/protocols/public/config.py
class IsJobConfig(IsJobConfigBase, Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsLocalRunnerConfig","title":"IsLocalRunnerConfig","text":"

Bases: IsEngineConfig, Protocol

Source code in src/omnipy/api/protocols/public/config.py
class IsLocalRunnerConfig(IsEngineConfig, Protocol):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsPrefectEngineConfig","title":"IsPrefectEngineConfig","text":"

Bases: IsEngineConfig, Protocol

Source code in src/omnipy/api/protocols/public/config.py
class IsPrefectEngineConfig(IsEngineConfig, Protocol):\n\"\"\"\"\"\"\n    use_cached_results: int = False\n
"},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsPrefectEngineConfig.use_cached_results","title":"use_cached_results: int = False instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig","title":"IsRootLogConfig","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/public/config.py
class IsRootLogConfig(Protocol):\n\"\"\"\"\"\"\n    log_format_str: str\n    locale: LocaleType\n    log_to_stdout: bool\n    log_to_stderr: bool\n    log_to_file: bool\n    stdout_log_min_level: int\n    stderr_log_min_level: int\n    file_log_min_level: int\n    file_log_dir_path: str\n
"},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.file_log_dir_path","title":"file_log_dir_path: str instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.file_log_min_level","title":"file_log_min_level: int instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.locale","title":"locale: LocaleType instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.log_format_str","title":"log_format_str: str instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.log_to_file","title":"log_to_file: bool instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.log_to_stderr","title":"log_to_stderr: bool instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.log_to_stdout","title":"log_to_stdout: bool instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.stderr_log_min_level","title":"stderr_log_min_level: int instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/config/#omnipy.api.protocols.public.config.IsRootLogConfig.stdout_log_min_level","title":"stdout_log_min_level: int instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/engine/","title":"engine","text":""},{"location":"reference/omnipy/api/protocols/public/engine/#omnipy.api.protocols.public.engine.IsDagFlowRunnerEngine","title":"IsDagFlowRunnerEngine","text":"

Bases: IsEngine, Protocol

Source code in src/omnipy/api/protocols/public/engine.py
@runtime_checkable\nclass IsDagFlowRunnerEngine(IsEngine, Protocol):\n\"\"\"\"\"\"\n    def apply_dag_flow_decorator(self, dag_flow: IsDagFlow,\n                                 job_callback_accept_decorator: Callable) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/engine/#omnipy.api.protocols.public.engine.IsDagFlowRunnerEngine.apply_dag_flow_decorator","title":"apply_dag_flow_decorator(dag_flow, job_callback_accept_decorator)","text":"Source code in src/omnipy/api/protocols/public/engine.py
def apply_dag_flow_decorator(self, dag_flow: IsDagFlow,\n                             job_callback_accept_decorator: Callable) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/engine/#omnipy.api.protocols.public.engine.IsFuncFlowRunnerEngine","title":"IsFuncFlowRunnerEngine","text":"

Bases: IsEngine, Protocol

Source code in src/omnipy/api/protocols/public/engine.py
@runtime_checkable\nclass IsFuncFlowRunnerEngine(IsEngine, Protocol):\n\"\"\"\"\"\"\n    def apply_func_flow_decorator(self,\n                                  func_flow: IsFuncFlow,\n                                  job_callback_accept_decorator: Callable) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/engine/#omnipy.api.protocols.public.engine.IsFuncFlowRunnerEngine.apply_func_flow_decorator","title":"apply_func_flow_decorator(func_flow, job_callback_accept_decorator)","text":"Source code in src/omnipy/api/protocols/public/engine.py
def apply_func_flow_decorator(self,\n                              func_flow: IsFuncFlow,\n                              job_callback_accept_decorator: Callable) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/engine/#omnipy.api.protocols.public.engine.IsLinearFlowRunnerEngine","title":"IsLinearFlowRunnerEngine","text":"

Bases: IsEngine, Protocol

Source code in src/omnipy/api/protocols/public/engine.py
@runtime_checkable\nclass IsLinearFlowRunnerEngine(IsEngine, Protocol):\n\"\"\"\"\"\"\n    def apply_linear_flow_decorator(self,\n                                    linear_flow: IsLinearFlow,\n                                    job_callback_accept_decorator: Callable) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/engine/#omnipy.api.protocols.public.engine.IsLinearFlowRunnerEngine.apply_linear_flow_decorator","title":"apply_linear_flow_decorator(linear_flow, job_callback_accept_decorator)","text":"Source code in src/omnipy/api/protocols/public/engine.py
def apply_linear_flow_decorator(self,\n                                linear_flow: IsLinearFlow,\n                                job_callback_accept_decorator: Callable) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/engine/#omnipy.api.protocols.public.engine.IsTaskRunnerEngine","title":"IsTaskRunnerEngine","text":"

Bases: IsEngine, Protocol

Source code in src/omnipy/api/protocols/public/engine.py
@runtime_checkable\nclass IsTaskRunnerEngine(IsEngine, Protocol):\n\"\"\"\"\"\"\n    def apply_task_decorator(self, task: IsTask, job_callback_accept_decorator: Callable) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/engine/#omnipy.api.protocols.public.engine.IsTaskRunnerEngine.apply_task_decorator","title":"apply_task_decorator(task, job_callback_accept_decorator)","text":"Source code in src/omnipy/api/protocols/public/engine.py
def apply_task_decorator(self, task: IsTask, job_callback_accept_decorator: Callable) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/","title":"hub","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRootLogObjects","title":"IsRootLogObjects","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/public/hub.py
class IsRootLogObjects(Protocol):\n\"\"\"\"\"\"\n    formatter: Optional[logging.Formatter] = None\n    stdout_handler: Optional[logging.StreamHandler] = None\n    stderr_handler: Optional[logging.StreamHandler] = None\n    file_handler: Optional[TimedRotatingFileHandler] = None\n\n    def set_config(self, config: IsRootLogConfig) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRootLogObjects.file_handler","title":"file_handler: Optional[TimedRotatingFileHandler] = None instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRootLogObjects.formatter","title":"formatter: Optional[logging.Formatter] = None instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRootLogObjects.stderr_handler","title":"stderr_handler: Optional[logging.StreamHandler] = None instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRootLogObjects.stdout_handler","title":"stdout_handler: Optional[logging.StreamHandler] = None instance-attribute class-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRootLogObjects.set_config","title":"set_config(config)","text":"Source code in src/omnipy/api/protocols/public/hub.py
def set_config(self, config: IsRootLogConfig) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntime","title":"IsRuntime","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/public/hub.py
class IsRuntime(Protocol):\n\"\"\"\"\"\"\n    config: IsRuntimeConfig\n    objects: IsRuntimeObjects\n\n    def __init__(\n            self,\n            config: Optional[IsRuntimeConfig] = None,  # noqa\n            objects: Optional[IsRuntimeObjects] = None,  # noqa\n            *args: Any,\n            **kwargs: Any) -> None:\n        ...\n\n    def reset_subscriptions(self):\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntime.config","title":"config: IsRuntimeConfig instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntime.objects","title":"objects: IsRuntimeObjects instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntime.__init__","title":"__init__(config=None, objects=None, *args, **kwargs)","text":"Source code in src/omnipy/api/protocols/public/hub.py
def __init__(\n        self,\n        config: Optional[IsRuntimeConfig] = None,  # noqa\n        objects: Optional[IsRuntimeObjects] = None,  # noqa\n        *args: Any,\n        **kwargs: Any) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntime.reset_subscriptions","title":"reset_subscriptions()","text":"Source code in src/omnipy/api/protocols/public/hub.py
def reset_subscriptions(self):\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeConfig","title":"IsRuntimeConfig","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/public/hub.py
class IsRuntimeConfig(Protocol):\n\"\"\"\"\"\"\n    job: IsJobConfig\n    engine: EngineChoice\n    local: IsLocalRunnerConfig\n    prefect: IsPrefectEngineConfig\n    root_log: IsRootLogConfig\n\n    def __init__(\n            self,\n            job: Optional[IsJobConfig] = None,  # noqa\n            engine: EngineChoice = EngineChoice.LOCAL,  # noqa\n            local: Optional[IsLocalRunnerConfig] = None,  # noqa\n            prefect: Optional[IsPrefectEngineConfig] = None,  # noqa\n            root_log: Optional[IsRootLogConfigEntryPublisher] = None,  # noqa\n            *args: Any,\n            **kwargs: Any) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeConfig.engine","title":"engine: EngineChoice instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeConfig.job","title":"job: IsJobConfig instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeConfig.local","title":"local: IsLocalRunnerConfig instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeConfig.prefect","title":"prefect: IsPrefectEngineConfig instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeConfig.root_log","title":"root_log: IsRootLogConfig instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeConfig.__init__","title":"__init__(job=None, engine=EngineChoice.LOCAL, local=None, prefect=None, root_log=None, *args, **kwargs)","text":"Source code in src/omnipy/api/protocols/public/hub.py
def __init__(\n        self,\n        job: Optional[IsJobConfig] = None,  # noqa\n        engine: EngineChoice = EngineChoice.LOCAL,  # noqa\n        local: Optional[IsLocalRunnerConfig] = None,  # noqa\n        prefect: Optional[IsPrefectEngineConfig] = None,  # noqa\n        root_log: Optional[IsRootLogConfigEntryPublisher] = None,  # noqa\n        *args: Any,\n        **kwargs: Any) -> None:\n    ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeObjects","title":"IsRuntimeObjects","text":"

Bases: Protocol

Source code in src/omnipy/api/protocols/public/hub.py
class IsRuntimeObjects(Protocol):\n\"\"\"\"\"\"\n\n    job_creator: IsJobConfigHolder\n    local: IsEngine\n    prefect: IsEngine\n    registry: IsRunStateRegistry\n    root_log: IsRootLogObjects\n\n    def __init__(\n            self,\n            job_creator: Optional[IsJobConfigHolder] = None,  # noqa\n            local: Optional[IsEngine] = None,  # noqa\n            prefect: Optional[IsEngine] = None,  # noqa\n            registry: Optional[IsRunStateRegistry] = None,  # noqa\n            root_log: Optional[IsRootLogObjects] = None,  # noqa\n            *args: Any,\n            **kwargs: Any) -> None:\n        ...\n
"},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeObjects.job_creator","title":"job_creator: IsJobConfigHolder instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeObjects.local","title":"local: IsEngine instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeObjects.prefect","title":"prefect: IsEngine instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeObjects.registry","title":"registry: IsRunStateRegistry instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeObjects.root_log","title":"root_log: IsRootLogObjects instance-attribute","text":""},{"location":"reference/omnipy/api/protocols/public/hub/#omnipy.api.protocols.public.hub.IsRuntimeObjects.__init__","title":"__init__(job_creator=None, local=None, prefect=None, registry=None, root_log=None, *args, **kwargs)","text":"Source code in src/omnipy/api/protocols/public/hub.py
def __init__(\n        self,\n        job_creator: Optional[IsJobConfigHolder] = None,  # noqa\n        local: Optional[IsEngine] = None,  # noqa\n        prefect: Optional[IsEngine] = None,  # noqa\n        registry: Optional[IsRunStateRegistry] = None,  # noqa\n        root_log: Optional[IsRootLogObjects] = None,  # noqa\n        *args: Any,\n        **kwargs: Any) -> None:\n    ...\n
"},{"location":"reference/omnipy/compute/","title":"compute","text":""},{"location":"reference/omnipy/compute/flow/","title":"flow","text":""},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.DagFlow","title":"DagFlow","text":"

Bases: JobMixin, FlowBase, TaskTemplateArgsJobBase

Source code in src/omnipy/compute/flow.py
class DagFlow(JobMixin, FlowBase, TaskTemplateArgsJobBase):\n    def _apply_engine_decorator(self, engine: IsEngine) -> None:\n        if self.engine:\n            engine = cast(IsDagFlowRunnerEngine, self.engine)\n            self_with_mixins = cast(IsDagFlow, self)\n            engine.apply_dag_flow_decorator(self_with_mixins, self._accept_call_func_decorator)\n\n    @classmethod\n    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:\n        return cast(Type[IsDagFlowTemplate], DagFlowTemplate)\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.DagFlowTemplate","title":"DagFlowTemplate","text":"

Bases: JobTemplateMixin, FlowBase, TaskTemplateArgsJobBase

Source code in src/omnipy/compute/flow.py
@dag_flow_template_callable_decorator_cls\nclass DagFlowTemplate(JobTemplateMixin, FlowBase, TaskTemplateArgsJobBase):\n    @classmethod\n    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:\n        return cast(Type[IsDagFlow], DagFlow)\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.FlowBase","title":"FlowBase","text":"Source code in src/omnipy/compute/flow.py
class FlowBase:\n    ...\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.FuncFlow","title":"FuncFlow","text":"

Bases: JobMixin, FlowBase, FuncArgJobBase

Source code in src/omnipy/compute/flow.py
class FuncFlow(JobMixin, FlowBase, FuncArgJobBase):\n    def _apply_engine_decorator(self, engine: IsEngine) -> None:\n        if self.engine:\n            engine = cast(IsFuncFlowRunnerEngine, self.engine)\n            self_with_mixins = cast(IsFuncFlow, self)\n            engine.apply_func_flow_decorator(self_with_mixins, self._accept_call_func_decorator)\n\n    @classmethod\n    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:\n        return cast(Type[IsFuncFlowTemplate], FuncFlowTemplate)\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.FuncFlowTemplate","title":"FuncFlowTemplate","text":"

Bases: JobTemplateMixin, FlowBase, FuncArgJobBase

Source code in src/omnipy/compute/flow.py
@func_flow_template_callable_decorator_cls\nclass FuncFlowTemplate(JobTemplateMixin, FlowBase, FuncArgJobBase):\n    @classmethod\n    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:\n        return cast(Type[IsFuncFlow], FuncFlow)\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.LinearFlow","title":"LinearFlow","text":"

Bases: JobMixin, FlowBase, TaskTemplateArgsJobBase

Source code in src/omnipy/compute/flow.py
class LinearFlow(JobMixin, FlowBase, TaskTemplateArgsJobBase):\n    def _apply_engine_decorator(self, engine: IsEngine) -> None:\n        if self.engine:\n            engine = cast(IsLinearFlowRunnerEngine, self.engine)\n            self_with_mixins = cast(IsLinearFlow, self)\n            engine.apply_linear_flow_decorator(self_with_mixins, self._accept_call_func_decorator)\n\n    @classmethod\n    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:\n        return cast(Type[IsLinearFlowTemplate], LinearFlowTemplate)\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.LinearFlowTemplate","title":"LinearFlowTemplate","text":"

Bases: JobTemplateMixin, FlowBase, TaskTemplateArgsJobBase

Source code in src/omnipy/compute/flow.py
@linear_flow_template_callable_decorator_cls\nclass LinearFlowTemplate(JobTemplateMixin, FlowBase, TaskTemplateArgsJobBase):\n    @classmethod\n    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:\n        return cast(Type[IsLinearFlow], LinearFlow)\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.dag_flow_template_callable_decorator_cls","title":"dag_flow_template_callable_decorator_cls(cls)","text":"Source code in src/omnipy/compute/flow.py
def dag_flow_template_callable_decorator_cls(\n    cls: Type['DagFlowTemplate']\n) -> IsTaskTemplateArgsJobTemplateCallable[IsTaskTemplate, IsDagFlowTemplate]:\n    return cast(IsTaskTemplateArgsJobTemplateCallable[IsTaskTemplate, IsDagFlowTemplate],\n                callable_decorator_cls(cls))\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.func_flow_template_callable_decorator_cls","title":"func_flow_template_callable_decorator_cls(cls)","text":"Source code in src/omnipy/compute/flow.py
def func_flow_template_callable_decorator_cls(\n        cls: Type['FuncFlowTemplate']) -> IsFuncArgJobTemplateCallable[IsFuncFlowTemplate]:\n    return cast(IsFuncArgJobTemplateCallable[IsFuncFlowTemplate], callable_decorator_cls(cls))\n
"},{"location":"reference/omnipy/compute/flow/#omnipy.compute.flow.linear_flow_template_callable_decorator_cls","title":"linear_flow_template_callable_decorator_cls(cls)","text":"Source code in src/omnipy/compute/flow.py
def linear_flow_template_callable_decorator_cls(\n    cls: Type['LinearFlowTemplate']\n) -> IsTaskTemplateArgsJobTemplateCallable[IsTaskTemplate, IsLinearFlowTemplate]:\n    return cast(IsTaskTemplateArgsJobTemplateCallable[IsTaskTemplate, IsLinearFlowTemplate],\n                callable_decorator_cls(cls))\n
"},{"location":"reference/omnipy/compute/func_job/","title":"func_job","text":""},{"location":"reference/omnipy/compute/func_job/#omnipy.compute.func_job.FuncArgJobBase","title":"FuncArgJobBase","text":"

Bases: PlainFuncArgJobBase

Source code in src/omnipy/compute/func_job.py
class FuncArgJobBase(PlainFuncArgJobBase):\n    ...\n
"},{"location":"reference/omnipy/compute/func_job/#omnipy.compute.func_job.PlainFuncArgJobBase","title":"PlainFuncArgJobBase","text":"

Bases: JobBase

Source code in src/omnipy/compute/func_job.py
class PlainFuncArgJobBase(JobBase):\n    def __init__(self, job_func: Callable, *args: object, **kwargs: object) -> None:\n        self._job_func = job_func\n\n    def _get_init_args(self) -> Tuple[object, ...]:\n        return self._job_func,\n\n    def has_coroutine_func(self) -> bool:\n        return asyncio.iscoroutinefunction(self._job_func)\n\n    def _call_job(self, *args: object, **kwargs: object) -> object:\n\"\"\"To be overloaded by mixins\"\"\"\n        return self._call_func(*args, **kwargs)\n\n    def _call_func(self, *args: object, **kwargs: object) -> object:\n\"\"\"\n        To be decorated by job runners and mixins that need early application. Should not\n        be overloaded using inheritance. The method _accept_call_func_decorator accepts\n        decorators.\n        \"\"\"\n        return self._job_func(*args, **kwargs)\n\n    def _accept_call_func_decorator(self, call_func_decorator: GeneralDecorator) -> None:\n        self._call_func = call_func_decorator(self._call_func)  # type:ignore\n
"},{"location":"reference/omnipy/compute/func_job/#omnipy.compute.func_job.PlainFuncArgJobBase.__init__","title":"__init__(job_func, *args, **kwargs)","text":"Source code in src/omnipy/compute/func_job.py
def __init__(self, job_func: Callable, *args: object, **kwargs: object) -> None:\n    self._job_func = job_func\n
"},{"location":"reference/omnipy/compute/func_job/#omnipy.compute.func_job.PlainFuncArgJobBase.has_coroutine_func","title":"has_coroutine_func()","text":"Source code in src/omnipy/compute/func_job.py
def has_coroutine_func(self) -> bool:\n    return asyncio.iscoroutinefunction(self._job_func)\n
"},{"location":"reference/omnipy/compute/job/","title":"job","text":""},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobBase","title":"JobBase","text":"

Bases: LogMixin, DynamicMixinAcceptor

Source code in src/omnipy/compute/job.py
class JobBase(LogMixin, DynamicMixinAcceptor, metaclass=JobBaseMeta):\n    @property\n    def _job_creator(self) -> IsJobCreator:\n        return self.__class__.job_creator\n\n    @property\n    def config(self) -> Optional[IsJobConfig]:\n        return self.__class__.job_creator.config\n\n    @property\n    def engine(self) -> Optional[IsEngine]:\n        return self.__class__.job_creator.engine\n\n    @property\n    def in_flow_context(self) -> bool:\n        return self.__class__.nested_context_level > 0\n\n    def __init__(self, *args: object, **kwargs: object):\n        # super().__init__()\n\n        # TODO: refactor using state machine\n\n        if not isinstance(self, JobTemplateMixin) and not isinstance(self, JobMixin):\n            raise JobStateException('JobBase and subclasses not inheriting from JobTemplateMixin '\n                                    'or JobMixin are not directly instantiatable')\n\n        from_apply = hasattr(self, '_from_apply') and self._from_apply is True\n        if isinstance(self, JobMixin) and not from_apply:\n            raise JobStateException(\n                'JobMixin should only be instantiated using the \"apply()\" method of '\n                'an instance of JobTemplateMixin (or one of its subclasses)')\n\n    @classmethod\n    def _create_job_template(cls, *args: object, **kwargs: object) -> IsJobTemplate:\n        if len(args) >= 1:\n            cls_as_callable_class = cast(Type[IsCallableClass], cls)\n\n            if not callable(args[0]):\n                raise TypeError(f'First argument of a job is assumed to be a callable, '\n                                f'not: {args[0]}')\n            job_func = args[0]\n            args = args[1:]\n            obj_1 = cls_as_callable_class(*args, **kwargs)(job_func)\n            return cast(IsJobTemplate, obj_1)\n        else:\n            obj_2 = cls(*args, **kwargs)\n            return cast(IsJobTemplate, obj_2)\n\n    @classmethod\n    def _create_job(cls, *args: object, **kwargs: object) -> IsJob:\n        if cls.__new__ is object.__new__:\n            obj = cls.__new__(cls)\n        else:\n            obj = cls.__new__(cls, *args, **kwargs)\n\n        # TODO: refactor using state machine\n\n        obj._from_apply = True\n        obj.__init__(*args, **kwargs)\n        obj._from_apply = False\n\n        return cast(IsJob, obj)\n\n    def _apply(self) -> IsJob:\n        job_cls = self._get_job_subcls_for_apply()\n        job = job_cls.create_job(*self._get_init_args(), **self._get_init_kwargs())\n\n        if self.engine:\n            job._apply_engine_decorator(self.engine)\n\n        return job\n\n    def _refine(self, *args: Any, update: bool = True, **kwargs: object) -> IsJobTemplate:\n        self_as_job_template = cast(IsJobTemplate, self)\n\n        refine_kwargs = kwargs.copy()\n\n        if update:\n            for key, cur_val in self._get_init_kwargs().items():\n                if key in refine_kwargs:\n                    refine_val = refine_kwargs[key]\n                    cur_val_dictable = as_dictable(cur_val)\n                    refine_val_dictable = as_dictable(refine_val)\n                    if cur_val_dictable is not None and refine_val_dictable is not None:\n                        new_val: Union[object,\n                                       Dict] = create_merged_dict(cur_val_dictable,\n                                                                  refine_val_dictable)\n                    else:\n                        new_val = refine_kwargs[key]\n                else:\n                    new_val = cur_val\n                refine_kwargs[key] = new_val\n\n        init_args = self._get_init_args()\n        refine_args = [init_args[0]] if len(init_args) >= 1 else []\n        refine_args += args if args else init_args[1:]\n\n        return self_as_job_template.create_job_template(*refine_args, **refine_kwargs)\n\n    def _revise(self) -> IsJobTemplate:\n        job_template_cls = self._get_job_template_subcls_for_revise()\n        job_template = job_template_cls.create_job_template(*self._get_init_args(),\n                                                            **self._get_init_kwargs())\n        return job_template\n\n    def _get_init_args(self) -> Tuple[object, ...]:\n        return ()\n\n    def _get_init_kwargs(self) -> Dict[str, object]:\n        kwarg_keys = list(self._mixin_init_kwarg_params_including_bases.keys())\n        for key in kwarg_keys:\n            attribute = getattr(self.__class__, key)\n\n            if not isinstance(attribute, property):\n                raise TypeError(f'{self.__class__.__name__} attribute \"{key}\" is not a property')\n\n            if attribute.fset is not None:\n                raise TypeError(f'{self.__class__.__name__} attribute \"{key}\" is not a property')\n\n            value = getattr(self, key)\n            if not isinstance(value, Hashable) and not isinstance(value, MappingProxyType):\n                raise TypeError(f'Value of {self.__class__.__name__} attribute \"{key}\" is mutable')\n\n        return {key: getattr(self, key) for key in kwarg_keys}\n\n    def __eq__(self, other: object) -> bool:\n        if not isinstance(other, JobBase):\n            return NotImplemented\n        return self._get_init_args() == other._get_init_args() \\\n            and self._get_init_kwargs() == other._get_init_kwargs()\n\n    @classmethod\n    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:\n        return IsJobTemplate\n\n    @classmethod\n    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:\n        return IsJob\n\n    def _call_job_template(self, *args: object, **kwargs: object) -> object:\n        self_as_job_template = cast(IsJobTemplate, self)\n\n        if self.in_flow_context:\n            return self_as_job_template.run(*args, **kwargs)\n\n        raise TypeError(f\"'{self.__class__.__name__}' object is not callable\")\n\n    def _call_job(self, *args: object, **kwargs: object) -> object:\n        pass\n\n    def _check_engine(self, engine_protocol: Type):\n        if self.engine is None or not isinstance(self.engine, engine_protocol):\n            raise RuntimeError(f'Engine \"{self.engine}\" does not support '\n                               f'job runner protocol: {engine_protocol.__name__}')\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobBase.config","title":"config: Optional[IsJobConfig] property","text":""},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobBase.engine","title":"engine: Optional[IsEngine] property","text":""},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobBase.in_flow_context","title":"in_flow_context: bool property","text":""},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobBase.__eq__","title":"__eq__(other)","text":"Source code in src/omnipy/compute/job.py
def __eq__(self, other: object) -> bool:\n    if not isinstance(other, JobBase):\n        return NotImplemented\n    return self._get_init_args() == other._get_init_args() \\\n        and self._get_init_kwargs() == other._get_init_kwargs()\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobBase.__init__","title":"__init__(*args, **kwargs)","text":"Source code in src/omnipy/compute/job.py
def __init__(self, *args: object, **kwargs: object):\n    # super().__init__()\n\n    # TODO: refactor using state machine\n\n    if not isinstance(self, JobTemplateMixin) and not isinstance(self, JobMixin):\n        raise JobStateException('JobBase and subclasses not inheriting from JobTemplateMixin '\n                                'or JobMixin are not directly instantiatable')\n\n    from_apply = hasattr(self, '_from_apply') and self._from_apply is True\n    if isinstance(self, JobMixin) and not from_apply:\n        raise JobStateException(\n            'JobMixin should only be instantiated using the \"apply()\" method of '\n            'an instance of JobTemplateMixin (or one of its subclasses)')\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobMixin","title":"JobMixin","text":"

Bases: DynamicMixinAcceptor

Source code in src/omnipy/compute/job.py
class JobMixin(DynamicMixinAcceptor):\n    def __init__(self, *args, **kwargs):\n        if JobBase not in self.__class__.__mro__:\n            raise TypeError('JobMixin is not meant to be instantiated outside the context '\n                            'of a JobBase subclass.')\n\n    @abstractmethod\n    def _apply_engine_decorator(self, engine: IsEngine) -> None:\n        ...\n\n    @property\n    def time_of_cur_toplevel_flow_run(self) -> Optional[datetime]:\n        self_as_job_base = cast(IsJobBase, self)\n        return self_as_job_base._job_creator.time_of_cur_toplevel_nested_context_run\n\n    @classmethod\n    def create_job(cls, *args: object, **kwargs: object) -> IsJob:\n        cls_as_job_base = cast(IsJobBase, cls)\n        return cls_as_job_base._create_job(*args, **kwargs)\n\n    def revise(self) -> IsJobTemplate:\n        self_as_job_base = cast(IsJobBase, self)\n        job_template = self_as_job_base._revise()\n        update_wrapper(job_template, self, updated=[])\n        return job_template\n\n    def __call__(self, *args: object, **kwargs: object) -> object:\n        self_as_job_base = cast(IsJobBase, self)\n\n        try:\n            return self_as_job_base._call_job(*args, **kwargs)\n        except Exception as e:\n            self_as_job_base.log(str(e), level=logging.ERROR)\n            raise\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobMixin.time_of_cur_toplevel_flow_run","title":"time_of_cur_toplevel_flow_run: Optional[datetime] property","text":""},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobMixin.__call__","title":"__call__(*args, **kwargs)","text":"Source code in src/omnipy/compute/job.py
def __call__(self, *args: object, **kwargs: object) -> object:\n    self_as_job_base = cast(IsJobBase, self)\n\n    try:\n        return self_as_job_base._call_job(*args, **kwargs)\n    except Exception as e:\n        self_as_job_base.log(str(e), level=logging.ERROR)\n        raise\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobMixin.__init__","title":"__init__(*args, **kwargs)","text":"Source code in src/omnipy/compute/job.py
def __init__(self, *args, **kwargs):\n    if JobBase not in self.__class__.__mro__:\n        raise TypeError('JobMixin is not meant to be instantiated outside the context '\n                        'of a JobBase subclass.')\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobMixin.create_job","title":"create_job(*args, **kwargs) classmethod","text":"Source code in src/omnipy/compute/job.py
@classmethod\ndef create_job(cls, *args: object, **kwargs: object) -> IsJob:\n    cls_as_job_base = cast(IsJobBase, cls)\n    return cls_as_job_base._create_job(*args, **kwargs)\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobMixin.revise","title":"revise()","text":"Source code in src/omnipy/compute/job.py
def revise(self) -> IsJobTemplate:\n    self_as_job_base = cast(IsJobBase, self)\n    job_template = self_as_job_base._revise()\n    update_wrapper(job_template, self, updated=[])\n    return job_template\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobTemplateMixin","title":"JobTemplateMixin","text":"Source code in src/omnipy/compute/job.py
class JobTemplateMixin:\n    def __init__(self, *args, **kwargs):\n        if JobBase not in self.__class__.__mro__:\n            raise TypeError('JobTemplateMixin is not meant to be instantiated outside the context '\n                            'of a JobBase subclass.')\n\n    @classmethod\n    def create_job_template(cls: Type[IsJobBase], *args: object, **kwargs: object) -> IsJobTemplate:\n        return cls._create_job_template(*args, **kwargs)\n\n    def run(self, *args: object, **kwargs: object) -> object:\n        # TODO: Using JobTemplateMixin.run() inside flows should give error message\n\n        return self.apply()(*args, **kwargs)\n\n    def apply(self) -> IsJob:\n        self_as_job_base = cast(IsJobBase, self)\n        job = self_as_job_base._apply()\n        update_wrapper(job, self, updated=[])\n        return job\n\n    def refine(self, *args: Any, update: bool = True, **kwargs: object) -> IsJobTemplate:\n        self_as_job_base = cast(IsJobBase, self)\n        return self_as_job_base._refine(*args, update=update, **kwargs)\n\n    def __call__(self, *args: object, **kwargs: object) -> object:\n        self_as_job_base = cast(IsJobBase, self)\n        return self_as_job_base._call_job_template(*args, **kwargs)\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobTemplateMixin.__call__","title":"__call__(*args, **kwargs)","text":"Source code in src/omnipy/compute/job.py
def __call__(self, *args: object, **kwargs: object) -> object:\n    self_as_job_base = cast(IsJobBase, self)\n    return self_as_job_base._call_job_template(*args, **kwargs)\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobTemplateMixin.__init__","title":"__init__(*args, **kwargs)","text":"Source code in src/omnipy/compute/job.py
def __init__(self, *args, **kwargs):\n    if JobBase not in self.__class__.__mro__:\n        raise TypeError('JobTemplateMixin is not meant to be instantiated outside the context '\n                        'of a JobBase subclass.')\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobTemplateMixin.apply","title":"apply()","text":"Source code in src/omnipy/compute/job.py
def apply(self) -> IsJob:\n    self_as_job_base = cast(IsJobBase, self)\n    job = self_as_job_base._apply()\n    update_wrapper(job, self, updated=[])\n    return job\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobTemplateMixin.create_job_template","title":"create_job_template(*args, **kwargs) classmethod","text":"Source code in src/omnipy/compute/job.py
@classmethod\ndef create_job_template(cls: Type[IsJobBase], *args: object, **kwargs: object) -> IsJobTemplate:\n    return cls._create_job_template(*args, **kwargs)\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobTemplateMixin.refine","title":"refine(*args, update=True, **kwargs)","text":"Source code in src/omnipy/compute/job.py
def refine(self, *args: Any, update: bool = True, **kwargs: object) -> IsJobTemplate:\n    self_as_job_base = cast(IsJobBase, self)\n    return self_as_job_base._refine(*args, update=update, **kwargs)\n
"},{"location":"reference/omnipy/compute/job/#omnipy.compute.job.JobTemplateMixin.run","title":"run(*args, **kwargs)","text":"Source code in src/omnipy/compute/job.py
def run(self, *args: object, **kwargs: object) -> object:\n    # TODO: Using JobTemplateMixin.run() inside flows should give error message\n\n    return self.apply()(*args, **kwargs)\n
"},{"location":"reference/omnipy/compute/job_creator/","title":"job_creator","text":""},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobBaseMeta","title":"JobBaseMeta","text":"

Bases: ABCMeta

Source code in src/omnipy/compute/job_creator.py
class JobBaseMeta(ABCMeta):\n\"\"\"\"\"\"\n    _job_creator_obj = JobCreator()\n\n    @property\n    def job_creator(self) -> IsJobCreator:\n        return self._job_creator_obj\n\n    @property\n    def nested_context_level(self) -> int:\n        return self.job_creator.nested_context_level\n
"},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobBaseMeta.job_creator","title":"job_creator: IsJobCreator property","text":""},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobBaseMeta.nested_context_level","title":"nested_context_level: int property","text":""},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator","title":"JobCreator","text":"Source code in src/omnipy/compute/job_creator.py
class JobCreator:\n    def __init__(self) -> None:\n        self._engine: Optional[IsEngine] = None\n        self._config: Optional[IsJobConfig] = None\n        self._nested_context_level: int = 0\n        self._time_of_cur_toplevel_nested_context_run: Optional[datetime] = None\n\n    def set_engine(self, engine: IsEngine) -> None:\n        self._engine = engine\n\n    def set_config(self, config: IsJobConfig) -> None:\n        self._config = config\n\n    def __enter__(self):\n        if self._nested_context_level == 0:\n            self._time_of_cur_toplevel_nested_context_run = datetime.now()\n\n        self._nested_context_level += 1\n\n    def __exit__(self, exc_type, exc_value, traceback):\n        self._nested_context_level -= 1\n\n        if self._nested_context_level == 0:\n            self._time_of_cur_toplevel_nested_context_run = None\n\n    @property\n    def engine(self) -> Optional[IsEngine]:\n        return self._engine\n\n    @property\n    def config(self) -> Optional[IsJobConfig]:\n        return self._config\n\n    @property\n    def nested_context_level(self) -> int:\n        return self._nested_context_level\n\n    @property\n    def time_of_cur_toplevel_nested_context_run(self) -> Optional[datetime]:\n        return self._time_of_cur_toplevel_nested_context_run\n
"},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.config","title":"config: Optional[IsJobConfig] property","text":""},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.engine","title":"engine: Optional[IsEngine] property","text":""},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.nested_context_level","title":"nested_context_level: int property","text":""},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.time_of_cur_toplevel_nested_context_run","title":"time_of_cur_toplevel_nested_context_run: Optional[datetime] property","text":""},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.__enter__","title":"__enter__()","text":"Source code in src/omnipy/compute/job_creator.py
def __enter__(self):\n    if self._nested_context_level == 0:\n        self._time_of_cur_toplevel_nested_context_run = datetime.now()\n\n    self._nested_context_level += 1\n
"},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.__exit__","title":"__exit__(exc_type, exc_value, traceback)","text":"Source code in src/omnipy/compute/job_creator.py
def __exit__(self, exc_type, exc_value, traceback):\n    self._nested_context_level -= 1\n\n    if self._nested_context_level == 0:\n        self._time_of_cur_toplevel_nested_context_run = None\n
"},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.__init__","title":"__init__()","text":"Source code in src/omnipy/compute/job_creator.py
def __init__(self) -> None:\n    self._engine: Optional[IsEngine] = None\n    self._config: Optional[IsJobConfig] = None\n    self._nested_context_level: int = 0\n    self._time_of_cur_toplevel_nested_context_run: Optional[datetime] = None\n
"},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.set_config","title":"set_config(config)","text":"Source code in src/omnipy/compute/job_creator.py
def set_config(self, config: IsJobConfig) -> None:\n    self._config = config\n
"},{"location":"reference/omnipy/compute/job_creator/#omnipy.compute.job_creator.JobCreator.set_engine","title":"set_engine(engine)","text":"Source code in src/omnipy/compute/job_creator.py
def set_engine(self, engine: IsEngine) -> None:\n    self._engine = engine\n
"},{"location":"reference/omnipy/compute/task/","title":"task","text":""},{"location":"reference/omnipy/compute/task/#omnipy.compute.task.Task","title":"Task","text":"

Bases: JobMixin, TaskBase, FuncArgJobBase

Source code in src/omnipy/compute/task.py
class Task(JobMixin, TaskBase, FuncArgJobBase):\n    def _apply_engine_decorator(self, engine: IsEngine) -> None:\n        if self.engine:\n            engine = cast(IsTaskRunnerEngine, self.engine)\n            self_with_mixins = cast(IsTask, self)\n            engine.apply_task_decorator(self_with_mixins, self._accept_call_func_decorator)\n\n    @classmethod\n    def _get_job_template_subcls_for_revise(cls) -> Type[IsJobTemplate]:\n        return cast(Type[IsTaskTemplate], TaskTemplate)\n
"},{"location":"reference/omnipy/compute/task/#omnipy.compute.task.TaskBase","title":"TaskBase","text":"Source code in src/omnipy/compute/task.py
class TaskBase:\n    # TODO: Can this and FlowBase be replaced with IsTask/IsFlow, or similar?\n    ...\n
"},{"location":"reference/omnipy/compute/task/#omnipy.compute.task.TaskTemplate","title":"TaskTemplate","text":"

Bases: JobTemplateMixin, TaskBase, FuncArgJobBase

Source code in src/omnipy/compute/task.py
@task_template_callable_decorator_cls\nclass TaskTemplate(JobTemplateMixin, TaskBase, FuncArgJobBase):\n\"\"\"\"\"\"\n    @classmethod\n    def _get_job_subcls_for_apply(cls) -> Type[IsJob]:\n        return cast(Type[IsTask], Task)\n
"},{"location":"reference/omnipy/compute/task/#omnipy.compute.task.task_template_callable_decorator_cls","title":"task_template_callable_decorator_cls(cls)","text":"Source code in src/omnipy/compute/task.py
def task_template_callable_decorator_cls(\n        cls: Type[TaskTemplate]) -> IsFuncArgJobTemplateCallable[IsTaskTemplate]:\n    return cast(IsFuncArgJobTemplateCallable[IsTaskTemplate], callable_decorator_cls(cls))\n
"},{"location":"reference/omnipy/compute/tasklist_job/","title":"tasklist_job","text":""},{"location":"reference/omnipy/compute/tasklist_job/#omnipy.compute.tasklist_job.TaskTemplateArgsJobBase","title":"TaskTemplateArgsJobBase","text":"

Bases: FuncArgJobBase

Source code in src/omnipy/compute/tasklist_job.py
class TaskTemplateArgsJobBase(FuncArgJobBase):\n    def __init__(self, job_func: Callable, *task_templates: IsTaskTemplate,\n                 **kwargs: object) -> None:\n        self._task_templates: Tuple[IsTaskTemplate, ...] = task_templates\n\n    def _get_init_args(self) -> Tuple[object, ...]:\n        return self._job_func, *self._task_templates\n\n    @property\n    def task_templates(self) -> Tuple[IsTaskTemplate, ...]:\n        return self._task_templates\n\n    def _refine(\n            self,\n            *task_templates: IsTaskTemplate,\n            update: bool = True,\n            **kwargs: object\n    ) -> IsTaskTemplateArgsJobTemplate[IsTaskTemplate, IsJobTemplate, IsJob]:\n\n        refined_template = super()._refine(\n            *task_templates,\n            update=update,\n            **kwargs,\n        )\n        return cast(IsTaskTemplateArgsJobTemplate[IsTaskTemplate, IsJobTemplate, IsJob],\n                    refined_template)\n
"},{"location":"reference/omnipy/compute/tasklist_job/#omnipy.compute.tasklist_job.TaskTemplateArgsJobBase.task_templates","title":"task_templates: Tuple[IsTaskTemplate, ...] property","text":""},{"location":"reference/omnipy/compute/tasklist_job/#omnipy.compute.tasklist_job.TaskTemplateArgsJobBase.__init__","title":"__init__(job_func, *task_templates, **kwargs)","text":"Source code in src/omnipy/compute/tasklist_job.py
def __init__(self, job_func: Callable, *task_templates: IsTaskTemplate,\n             **kwargs: object) -> None:\n    self._task_templates: Tuple[IsTaskTemplate, ...] = task_templates\n
"},{"location":"reference/omnipy/compute/typing/","title":"typing","text":""},{"location":"reference/omnipy/compute/typing/#omnipy.compute.typing.mypy_fix_dag_flow_template","title":"mypy_fix_dag_flow_template(dag_flow_template)","text":"Source code in src/omnipy/compute/typing.py
def mypy_fix_dag_flow_template(dag_flow_template: object) -> 'IsDagFlowTemplate':\n    return cast('IsDagFlowTemplate', dag_flow_template)\n
"},{"location":"reference/omnipy/compute/typing/#omnipy.compute.typing.mypy_fix_func_flow_template","title":"mypy_fix_func_flow_template(func_flow_template)","text":"Source code in src/omnipy/compute/typing.py
def mypy_fix_func_flow_template(func_flow_template: object) -> 'IsFuncFlowTemplate':\n    return cast('IsFuncFlowTemplate', func_flow_template)\n
"},{"location":"reference/omnipy/compute/typing/#omnipy.compute.typing.mypy_fix_linear_flow_template","title":"mypy_fix_linear_flow_template(linear_flow_template)","text":"Source code in src/omnipy/compute/typing.py
def mypy_fix_linear_flow_template(linear_flow_template: object) -> 'IsLinearFlowTemplate':\n    return cast('IsLinearFlowTemplate', linear_flow_template)\n
"},{"location":"reference/omnipy/compute/typing/#omnipy.compute.typing.mypy_fix_task_template","title":"mypy_fix_task_template(task_template)","text":"Source code in src/omnipy/compute/typing.py
def mypy_fix_task_template(task_template: object) -> 'IsTaskTemplate':\n    return cast('IsTaskTemplate', task_template)\n
"},{"location":"reference/omnipy/compute/mixins/","title":"mixins","text":""},{"location":"reference/omnipy/compute/mixins/flow_context/","title":"flow_context","text":""},{"location":"reference/omnipy/compute/mixins/flow_context/#omnipy.compute.mixins.flow_context.FlowContextJobMixin","title":"FlowContextJobMixin","text":"Source code in src/omnipy/compute/mixins/flow_context.py
class FlowContextJobMixin:\n\"\"\"\"\"\"\n    def __init__(self) -> None:\n        self._time_of_last_run = None\n\n    @property\n    def flow_context(self) -> IsNestedContext:\n        class FlowContext:\n            @classmethod\n            def __enter__(cls):\n                self.__class__.job_creator.__enter__()\n                self._time_of_last_run = self.time_of_cur_toplevel_flow_run\n\n            @classmethod\n            def __exit__(cls, exc_type, exc_val, exc_tb):\n                self.__class__.job_creator.__exit__(exc_type, exc_val, exc_tb)\n\n        return FlowContext()\n\n    @property\n    def time_of_last_run(self) -> Optional[datetime]:\n        return self._time_of_last_run\n
"},{"location":"reference/omnipy/compute/mixins/flow_context/#omnipy.compute.mixins.flow_context.FlowContextJobMixin.flow_context","title":"flow_context: IsNestedContext property","text":""},{"location":"reference/omnipy/compute/mixins/flow_context/#omnipy.compute.mixins.flow_context.FlowContextJobMixin.time_of_last_run","title":"time_of_last_run: Optional[datetime] property","text":""},{"location":"reference/omnipy/compute/mixins/flow_context/#omnipy.compute.mixins.flow_context.FlowContextJobMixin.__init__","title":"__init__()","text":"Source code in src/omnipy/compute/mixins/flow_context.py
def __init__(self) -> None:\n    self._time_of_last_run = None\n
"},{"location":"reference/omnipy/compute/mixins/func_signature/","title":"func_signature","text":""},{"location":"reference/omnipy/compute/mixins/func_signature/#omnipy.compute.mixins.func_signature.SignatureFuncJobBaseMixin","title":"SignatureFuncJobBaseMixin","text":"Source code in src/omnipy/compute/mixins/func_signature.py
class SignatureFuncJobBaseMixin:\n    def __init__(self):\n        self._func_signature = inspect.signature(self._job_func)\n        self.__signature__ = self._func_signature\n\n    @property\n    def param_signatures(self) -> MappingProxyType:\n        return self._func_signature.parameters\n\n    @property\n    def return_type(self) -> Type[object]:\n        return self._func_signature.return_annotation\n\n    def _check_param_keys_in_func_signature(self,\n                                            param_keys: Iterable[str],\n                                            modifier_kwarg_key: str) -> None:\n        if any(param.kind == inspect.Parameter.VAR_KEYWORD\n               for param in self.param_signatures.values()):\n            return\n\n        for param_key in param_keys:\n            if param_key not in self.param_signatures:\n                raise KeyError('Parameter \"{}\" was not found in the '.format(param_key)\n                               + 'signature of the job function. Only parameters in the '\n                               'signature of the job function are '\n                               f'allowed as keys in the \"{modifier_kwarg_key}\" modifier: '\n                               f\"{', '.join(key for key in self.param_signatures.keys())}\")\n\n    def _update_func_signature(self, new_signature: inspect.Signature):\n        # self._job_func.__signature__ = new_signature\n        self._func_signature = new_signature\n        self.__signature__ = new_signature\n\n    def get_call_args(self, *args: object, **kwargs: object) -> Dict[str, object]:\n        return self._func_signature.bind(*args, **kwargs).arguments\n
"},{"location":"reference/omnipy/compute/mixins/func_signature/#omnipy.compute.mixins.func_signature.SignatureFuncJobBaseMixin.__signature__","title":"__signature__ = self._func_signature instance-attribute","text":""},{"location":"reference/omnipy/compute/mixins/func_signature/#omnipy.compute.mixins.func_signature.SignatureFuncJobBaseMixin.param_signatures","title":"param_signatures: MappingProxyType property","text":""},{"location":"reference/omnipy/compute/mixins/func_signature/#omnipy.compute.mixins.func_signature.SignatureFuncJobBaseMixin.return_type","title":"return_type: Type[object] property","text":""},{"location":"reference/omnipy/compute/mixins/func_signature/#omnipy.compute.mixins.func_signature.SignatureFuncJobBaseMixin.__init__","title":"__init__()","text":"Source code in src/omnipy/compute/mixins/func_signature.py
def __init__(self):\n    self._func_signature = inspect.signature(self._job_func)\n    self.__signature__ = self._func_signature\n
"},{"location":"reference/omnipy/compute/mixins/func_signature/#omnipy.compute.mixins.func_signature.SignatureFuncJobBaseMixin.get_call_args","title":"get_call_args(*args, **kwargs)","text":"Source code in src/omnipy/compute/mixins/func_signature.py
def get_call_args(self, *args: object, **kwargs: object) -> Dict[str, object]:\n    return self._func_signature.bind(*args, **kwargs).arguments\n
"},{"location":"reference/omnipy/compute/mixins/iterate/","title":"iterate","text":""},{"location":"reference/omnipy/compute/mixins/iterate/#omnipy.compute.mixins.iterate.IterateFuncJobBaseMixin","title":"IterateFuncJobBaseMixin","text":"Source code in src/omnipy/compute/mixins/iterate.py
class IterateFuncJobBaseMixin:\n    def __init__(self, *, iterate_over_data_files: bool = False):\n        self_as_plain_func_arg_job_base = cast(IsPlainFuncArgJobBase, self)\n        self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)\n\n        self._iterate_over_data_files = iterate_over_data_files\n\n        if not isinstance(self.iterate_over_data_files, bool):\n            raise TypeError(\n                'Value of \"iterate_over_data_files\" parameter must be bool (True/False), '\n                f'not \"{iterate_over_data_files}\"')\n\n        if iterate_over_data_files:\n            job_func = self_as_plain_func_arg_job_base._job_func\n            if job_func.__name__ != '_omnipy_iterate_func':\n\n                def _iterate_over_data_files_decorator(call_func: Callable):\n                    def _omnipy_iterate_func(\n                        dataset: InputDatasetT,\n                        *args: object,\n                        **kwargs: object,\n                    ) -> ReturnDatasetT:\n                        inner_func: IsIterateInnerCallable = \\\n                            cast(IsIterateInnerCallable, call_func)\n\n                        return_type = signature(job_func).return_annotation\n                        out_dataset_cls = _create_dataset_cls(return_type)\n                        out_dataset = out_dataset_cls()\n\n                        for title, data_file in dataset.items():\n                            out_dataset[title] = inner_func(data_file, *args, **kwargs)\n\n                        return out_dataset\n\n                    return _omnipy_iterate_func\n\n                _check_job_func_parameters(job_func)\n                self_as_plain_func_arg_job_base._accept_call_func_decorator(\n                    _iterate_over_data_files_decorator)\n\n                new_signature = _generate_new_signature(job_func)\n                self_as_signature_func_job_base_mixin._update_func_signature(new_signature)\n\n    @property\n    def iterate_over_data_files(self) -> bool:\n        return self._iterate_over_data_files\n
"},{"location":"reference/omnipy/compute/mixins/iterate/#omnipy.compute.mixins.iterate.IterateFuncJobBaseMixin.iterate_over_data_files","title":"iterate_over_data_files: bool property","text":""},{"location":"reference/omnipy/compute/mixins/iterate/#omnipy.compute.mixins.iterate.IterateFuncJobBaseMixin.__init__","title":"__init__(*, iterate_over_data_files=False)","text":"Source code in src/omnipy/compute/mixins/iterate.py
def __init__(self, *, iterate_over_data_files: bool = False):\n    self_as_plain_func_arg_job_base = cast(IsPlainFuncArgJobBase, self)\n    self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)\n\n    self._iterate_over_data_files = iterate_over_data_files\n\n    if not isinstance(self.iterate_over_data_files, bool):\n        raise TypeError(\n            'Value of \"iterate_over_data_files\" parameter must be bool (True/False), '\n            f'not \"{iterate_over_data_files}\"')\n\n    if iterate_over_data_files:\n        job_func = self_as_plain_func_arg_job_base._job_func\n        if job_func.__name__ != '_omnipy_iterate_func':\n\n            def _iterate_over_data_files_decorator(call_func: Callable):\n                def _omnipy_iterate_func(\n                    dataset: InputDatasetT,\n                    *args: object,\n                    **kwargs: object,\n                ) -> ReturnDatasetT:\n                    inner_func: IsIterateInnerCallable = \\\n                        cast(IsIterateInnerCallable, call_func)\n\n                    return_type = signature(job_func).return_annotation\n                    out_dataset_cls = _create_dataset_cls(return_type)\n                    out_dataset = out_dataset_cls()\n\n                    for title, data_file in dataset.items():\n                        out_dataset[title] = inner_func(data_file, *args, **kwargs)\n\n                    return out_dataset\n\n                return _omnipy_iterate_func\n\n            _check_job_func_parameters(job_func)\n            self_as_plain_func_arg_job_base._accept_call_func_decorator(\n                _iterate_over_data_files_decorator)\n\n            new_signature = _generate_new_signature(job_func)\n            self_as_signature_func_job_base_mixin._update_func_signature(new_signature)\n
"},{"location":"reference/omnipy/compute/mixins/mixin_types/","title":"mixin_types","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.InputDatasetT","title":"InputDatasetT = Union[Dataset[Model[InputT]], Dataset[ModelInputT]] module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.InputT","title":"InputT = TypeVar('InputT', bound=object) module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.InputTypeT","title":"InputTypeT = Union[InputT, ModelInputT] module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.ModelInputT","title":"ModelInputT = TypeVar('ModelInputT', bound=Model) module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.ModelReturnT","title":"ModelReturnT = TypeVar('ModelReturnT', bound=Model) module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.ReturnDatasetT","title":"ReturnDatasetT = Union[Dataset[Model[ReturnT]], Dataset[ModelReturnT]] module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.ReturnT","title":"ReturnT = TypeVar('ReturnT', bound=object) module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.IsIterateInnerCallable","title":"IsIterateInnerCallable","text":"

Bases: Protocol

Source code in src/omnipy/compute/mixins/mixin_types.py
class IsIterateInnerCallable(Protocol):\n\"\"\"\"\"\"\n    def __call__(\n        self,\n        data_file: Union[InputT, ModelInputT],\n        *args: object,\n        **kwargs: object,\n    ) -> Union[ReturnT, ModelReturnT]:\n        ...\n\n    __name__: str\n
"},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.IsIterateInnerCallable.__name__","title":"__name__: str instance-attribute","text":""},{"location":"reference/omnipy/compute/mixins/mixin_types/#omnipy.compute.mixins.mixin_types.IsIterateInnerCallable.__call__","title":"__call__(data_file, *args, **kwargs)","text":"Source code in src/omnipy/compute/mixins/mixin_types.py
def __call__(\n    self,\n    data_file: Union[InputT, ModelInputT],\n    *args: object,\n    **kwargs: object,\n) -> Union[ReturnT, ModelReturnT]:\n    ...\n
"},{"location":"reference/omnipy/compute/mixins/name/","title":"name","text":""},{"location":"reference/omnipy/compute/mixins/name/#omnipy.compute.mixins.name.NameJobBaseMixin","title":"NameJobBaseMixin","text":"Source code in src/omnipy/compute/mixins/name.py
class NameJobBaseMixin:\n    def __init__(self, *, name: Optional[str] = None):\n        self._name: Optional[str] = name\n\n        if self._name is not None:\n            self._check_not_empty_string('name', self._name)\n        else:\n            if hasattr(self, '_job_func'):\n                self._name = self._job_func.__name__\n\n        # TODO: When job state machine is implemented, check using that to see if in job state\n        self._unique_name = self._generate_unique_name() if hasattr(self, 'create_job') else None\n\n    @staticmethod\n    def _check_not_empty_string(param_name: str, param: str) -> None:\n        if len(param) == 0:\n            raise ValueError('Empty strings not allowed for parameter \"{}\"'.format(param_name))\n\n    @property\n    def name(self) -> Optional[str]:\n        return self._name\n\n    @property\n    def unique_name(self) -> Optional[str]:\n        return self._unique_name\n\n    def _generate_unique_name(self) -> Optional[str]:\n        if self._name is None:\n            return None\n\n        class_name = self.__class__.__name__\n        if class_name.endswith(DynamicMixinAcceptor.WITH_MIXINS_CLS_PREFIX):\n            class_name = class_name[:-len(DynamicMixinAcceptor.WITH_MIXINS_CLS_PREFIX)]\n\n        class_name_snake_case = underscore(class_name)\n        return slugify(f'{class_name_snake_case}-{self._name}-{generate_slug(2)}')\n\n    def _regenerate_unique_name(self) -> None:\n        self._unique_name = self._generate_unique_name()\n
"},{"location":"reference/omnipy/compute/mixins/name/#omnipy.compute.mixins.name.NameJobBaseMixin.name","title":"name: Optional[str] property","text":""},{"location":"reference/omnipy/compute/mixins/name/#omnipy.compute.mixins.name.NameJobBaseMixin.unique_name","title":"unique_name: Optional[str] property","text":""},{"location":"reference/omnipy/compute/mixins/name/#omnipy.compute.mixins.name.NameJobBaseMixin.__init__","title":"__init__(*, name=None)","text":"Source code in src/omnipy/compute/mixins/name.py
def __init__(self, *, name: Optional[str] = None):\n    self._name: Optional[str] = name\n\n    if self._name is not None:\n        self._check_not_empty_string('name', self._name)\n    else:\n        if hasattr(self, '_job_func'):\n            self._name = self._job_func.__name__\n\n    # TODO: When job state machine is implemented, check using that to see if in job state\n    self._unique_name = self._generate_unique_name() if hasattr(self, 'create_job') else None\n
"},{"location":"reference/omnipy/compute/mixins/name/#omnipy.compute.mixins.name.NameJobMixin","title":"NameJobMixin","text":"Source code in src/omnipy/compute/mixins/name.py
class NameJobMixin:\n    def regenerate_unique_name(self) -> None:\n        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)\n        self_as_name_job_base_mixin._regenerate_unique_name()\n
"},{"location":"reference/omnipy/compute/mixins/name/#omnipy.compute.mixins.name.NameJobMixin.regenerate_unique_name","title":"regenerate_unique_name()","text":"Source code in src/omnipy/compute/mixins/name.py
def regenerate_unique_name(self) -> None:\n    self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)\n    self_as_name_job_base_mixin._regenerate_unique_name()\n
"},{"location":"reference/omnipy/compute/mixins/params/","title":"params","text":""},{"location":"reference/omnipy/compute/mixins/params/#omnipy.compute.mixins.params.ParamsFuncJobBaseMixin","title":"ParamsFuncJobBaseMixin","text":"Source code in src/omnipy/compute/mixins/params.py
class ParamsFuncJobBaseMixin:\n    def __init__(\n        self,\n        *,\n        fixed_params: Optional[Mapping[str, object]] = None,\n        param_key_map: Optional[Mapping[str, str]] = None,\n    ):\n        self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)\n\n        self._fixed_params = dict(fixed_params) if fixed_params is not None else {}\n        self._param_key_mapper = ParamKeyMapper(param_key_map if param_key_map is not None else {})\n\n        self_as_signature_func_job_base_mixin._check_param_keys_in_func_signature(\n            self.fixed_params.keys(), 'fixed_params')\n        self_as_signature_func_job_base_mixin._check_param_keys_in_func_signature(\n            self.param_key_map.keys(), 'param_key_map')\n\n    @property\n    def fixed_params(self) -> MappingProxyType[str, object]:\n        return MappingProxyType(self._fixed_params)\n\n    @property\n    def param_key_map(self) -> MappingProxyType[str, str]:\n        return MappingProxyType(self._param_key_mapper.key_map)\n\n    def _call_job(self, *args: object, **kwargs: object) -> object:\n        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)\n        self_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)\n\n        mapped_fixed_params = self._param_key_mapper.delete_matching_keys(\n            self._fixed_params, inverse=True)\n        mapped_kwargs = self._param_key_mapper.map_matching_keys_delete_inverse_matches_keep_rest(\n            kwargs, inverse=True)\n        try:\n            if len(mapped_kwargs) < len(kwargs):\n                raise TypeError('Keyword arguments {} matches parameter key map inversely.'.format(\n                    tuple(set(kwargs.keys()) - set(mapped_kwargs.keys()))))\n\n            super_as_job_base = cast(IsJobBase, super())\n            result = super_as_job_base._call_job(*args, **mapped_fixed_params, **mapped_kwargs)\n\n        except TypeError as e:\n            if str(e).startswith('Incorrect job function arguments'):\n                raise TypeError(\n                    f'Incorrect job function arguments for job \"{self_as_name_job_base_mixin.name}\"!\\n'\n                    f'Job class name: {self.__class__.__name__}\\n'\n                    f'Current parameter key map contents: {self.param_key_map}\\n'\n                    f'Positional arguments: {repr_max_len(args)}\\n'\n                    f'Keyword arguments: {repr_max_len(kwargs)}\\n'\n                    f'Mapped fixed parameters: {repr_max_len(mapped_fixed_params)}\\n'\n                    f'Mapped keyword arguments: {repr_max_len(mapped_kwargs)}\\n'\n                    f'Call function signature parameters: '\n                    f'{[(str(p), p.kind) for p in self_signature_func_job_base_mixin.param_signatures.values()]}'\n                ) from e\n            else:\n                raise\n\n        return result\n
"},{"location":"reference/omnipy/compute/mixins/params/#omnipy.compute.mixins.params.ParamsFuncJobBaseMixin.fixed_params","title":"fixed_params: MappingProxyType[str, object] property","text":""},{"location":"reference/omnipy/compute/mixins/params/#omnipy.compute.mixins.params.ParamsFuncJobBaseMixin.param_key_map","title":"param_key_map: MappingProxyType[str, str] property","text":""},{"location":"reference/omnipy/compute/mixins/params/#omnipy.compute.mixins.params.ParamsFuncJobBaseMixin.__init__","title":"__init__(*, fixed_params=None, param_key_map=None)","text":"Source code in src/omnipy/compute/mixins/params.py
def __init__(\n    self,\n    *,\n    fixed_params: Optional[Mapping[str, object]] = None,\n    param_key_map: Optional[Mapping[str, str]] = None,\n):\n    self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)\n\n    self._fixed_params = dict(fixed_params) if fixed_params is not None else {}\n    self._param_key_mapper = ParamKeyMapper(param_key_map if param_key_map is not None else {})\n\n    self_as_signature_func_job_base_mixin._check_param_keys_in_func_signature(\n        self.fixed_params.keys(), 'fixed_params')\n    self_as_signature_func_job_base_mixin._check_param_keys_in_func_signature(\n        self.param_key_map.keys(), 'param_key_map')\n
"},{"location":"reference/omnipy/compute/mixins/result_key/","title":"result_key","text":""},{"location":"reference/omnipy/compute/mixins/result_key/#omnipy.compute.mixins.result_key.ResultKeyFuncJobBaseMixin","title":"ResultKeyFuncJobBaseMixin","text":"Source code in src/omnipy/compute/mixins/result_key.py
class ResultKeyFuncJobBaseMixin:\n    def __init__(self, *, result_key: Optional[str] = None):\n        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)\n\n        self._result_key = result_key\n\n        if self.result_key is not None:\n            self_as_name_job_base_mixin._check_not_empty_string('result_key', self.result_key)\n\n    @property\n    def result_key(self) -> Optional[str]:\n        return self._result_key\n\n    def _call_job(self, *args: object, **kwargs: object) -> object:\n        super_as_job_base = cast(IsJobBase, super())\n        result = super_as_job_base._call_job(*args, **kwargs)\n\n        if self._result_key:\n            return {self._result_key: result}\n        else:\n            return result\n
"},{"location":"reference/omnipy/compute/mixins/result_key/#omnipy.compute.mixins.result_key.ResultKeyFuncJobBaseMixin.result_key","title":"result_key: Optional[str] property","text":""},{"location":"reference/omnipy/compute/mixins/result_key/#omnipy.compute.mixins.result_key.ResultKeyFuncJobBaseMixin.__init__","title":"__init__(*, result_key=None)","text":"Source code in src/omnipy/compute/mixins/result_key.py
def __init__(self, *, result_key: Optional[str] = None):\n    self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)\n\n    self._result_key = result_key\n\n    if self.result_key is not None:\n        self_as_name_job_base_mixin._check_not_empty_string('result_key', self.result_key)\n
"},{"location":"reference/omnipy/compute/mixins/serialize/","title":"serialize","text":""},{"location":"reference/omnipy/compute/mixins/serialize/#omnipy.compute.mixins.serialize.PersistOpts","title":"PersistOpts = PersistOutputsOptions module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/serialize/#omnipy.compute.mixins.serialize.RestoreOpts","title":"RestoreOpts = RestoreOutputsOptions module-attribute","text":""},{"location":"reference/omnipy/compute/mixins/serialize/#omnipy.compute.mixins.serialize.SerializerFuncJobBaseMixin","title":"SerializerFuncJobBaseMixin","text":"Source code in src/omnipy/compute/mixins/serialize.py
class SerializerFuncJobBaseMixin:\n    def __init__(self,\n                 *,\n                 persist_outputs: Optional[PersistOutputsOptions] = None,\n                 restore_outputs: Optional[RestoreOutputsOptions] = None):\n\n        # TODO: Possibly reimplement logic using a state machine, e.g. \"transitions\" package\n        if persist_outputs is None:\n            self._persist_outputs = PersistOpts.FOLLOW_CONFIG if self._has_job_config else None\n        else:\n            self._persist_outputs = PersistOpts(persist_outputs)\n\n        if restore_outputs is None:\n            self._restore_outputs = RestoreOpts.FOLLOW_CONFIG if self._has_job_config else None\n        else:\n            self._restore_outputs = RestoreOpts(restore_outputs)\n\n        self._serializer_registry = self._create_serializer_registry()\n\n    def _create_serializer_registry(self):\n        # TODO: store in runtime, to remove dependencies\n        registry = SerializerRegistry()\n\n        registry.register(PandasDatasetToTarFileSerializer)\n        registry.register(RawDatasetToTarFileSerializer)\n        registry.register(JsonDatasetToTarFileSerializer)\n\n        return registry\n\n    @property\n    def _has_job_config(self) -> bool:\n        self_as_job_base = cast(IsJobBase, self)\n        return self_as_job_base.config is not None\n\n    @property\n    def _job_config(self) -> IsJobConfig:\n        self_as_job_base = cast(IsJobBase, self)\n        if self_as_job_base.config is None:\n            return JobConfig()\n        else:\n            return self_as_job_base.config\n\n    def _log(self, msg: str) -> None:\n        self_as_job_base = cast(IsJobBase, self)\n        self_as_job_base.log(msg)\n\n    @property\n    def _return_type(self) -> Type[object]:\n        self_as_signature_func_job_base_mixin = cast(SignatureFuncJobBaseMixin, self)\n        return self_as_signature_func_job_base_mixin.return_type\n\n    @property\n    def persist_outputs(self) -> Optional[PersistOutputsOptions]:\n        return self._persist_outputs\n\n    @property\n    def restore_outputs(self) -> Optional[RestoreOutputsOptions]:\n        return self._restore_outputs\n\n    @property\n    def will_persist_outputs(self) -> PersistOutputsOptions:\n        if not self._has_job_config or self._persist_outputs is not PersistOpts.FOLLOW_CONFIG:\n            return self._persist_outputs if self._persist_outputs is not None \\\n                else PersistOpts.DISABLED\n        else:\n            # TODO: Refactor using Flow and Task Mixins\n            from omnipy.compute.flow import FlowBase\n            from omnipy.compute.task import TaskBase\n\n            config_persist_opt = self._job_config.persist_outputs\n\n            if config_persist_opt == ConfigPersistOpts.ENABLE_FLOW_OUTPUTS:\n                return PersistOpts.ENABLED if isinstance(self, FlowBase) else PersistOpts.DISABLED\n            elif config_persist_opt == ConfigPersistOpts.ENABLE_FLOW_AND_TASK_OUTPUTS:\n                return PersistOpts.ENABLED \\\n                    if any(isinstance(self, cls) for cls in (FlowBase, TaskBase)) \\\n                    else PersistOpts.DISABLED\n            else:\n                assert config_persist_opt == ConfigPersistOpts.DISABLED\n                return PersistOpts.DISABLED\n\n    @property\n    def will_restore_outputs(self) -> RestoreOutputsOptions:\n        if not self._has_job_config or self._restore_outputs is not RestoreOpts.FOLLOW_CONFIG:\n            return self._restore_outputs if self._restore_outputs is not None \\\n                else RestoreOpts.DISABLED\n        else:\n            config_restore_opt = self._job_config.restore_outputs\n\n            if config_restore_opt == ConfigRestoreOpts.AUTO_ENABLE_IGNORE_PARAMS:\n                return RestoreOpts.AUTO_ENABLE_IGNORE_PARAMS\n            assert config_restore_opt == ConfigRestoreOpts.DISABLED\n            return RestoreOpts.DISABLED\n\n    def _call_job(self, *args: object, **kwargs: object) -> object:\n        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)\n\n        if self.will_restore_outputs in [\n                RestoreOpts.AUTO_ENABLE_IGNORE_PARAMS, RestoreOpts.FORCE_ENABLE_IGNORE_PARAMS\n        ]:\n            try:\n                return self._deserialize_and_restore_outputs()\n            except Exception:\n                if self.will_restore_outputs is RestoreOpts.FORCE_ENABLE_IGNORE_PARAMS:\n                    raise\n\n        super_as_job_base = cast(IsJobBase, super())\n        results = super_as_job_base._call_job(*args, **kwargs)\n\n        if self.will_persist_outputs is PersistOpts.ENABLED:\n            if isinstance(results, Dataset):\n                self._serialize_and_persist_outputs(results)\n            else:\n                self._log(\n                    f'Results of {self_as_name_job_base_mixin.unique_name} is not a Dataset and '\n                    f'cannot be automatically serialized and persisted!')\n\n        return results\n\n    def _serialize_and_persist_outputs(self, results: Dataset):\n        self_as_name_job_base_mixin = cast(NameJobBaseMixin, self)\n\n        datetime_str = self._generate_datetime_str()\n        output_path = Path(self._job_config.persist_data_dir_path).joinpath(datetime_str)\n\n        if not os.path.exists(output_path):\n            os.makedirs(output_path)\n\n        num_cur_files = len(os.listdir(output_path))\n        job_name = self._job_name()\n\n        file_path = output_path.joinpath(f'{num_cur_files:02}_{job_name}.tar.gz')\n\n        parsed_dataset, serializer = \\\n            self._serializer_registry.auto_detect_tar_file_serializer(results)\n\n        if serializer is None:\n            self._log('Unable to find a serializer for results of job '\n                      f'\"{self_as_name_job_base_mixin.name}\", with data type \"{type(results)}\". '\n                      f'Will abort persisting results...')\n        else:\n            self._log(f'Writing dataset as a gzipped tarpack to \"{os.path.abspath(file_path)}\"')\n\n            with open(file_path, 'wb') as tarfile:\n                tarfile.write(serializer.serialize(parsed_dataset))\n\n    def _job_name(self):\n        return '_'.join(self.unique_name.split('-')[:-2])\n\n    def _generate_datetime_str(self):\n        if self.time_of_cur_toplevel_flow_run:\n            run_time = self.time_of_cur_toplevel_flow_run\n        else:\n            if hasattr(self, 'time_of_last_run') and self.time_of_last_run:\n                run_time = self.time_of_last_run\n            else:\n                run_time = datetime.now()\n        datetime_str = run_time.strftime('%Y_%m_%d-%H_%M_%S')\n        return datetime_str\n\n    @staticmethod\n    def _all_job_output_file_paths_in_reverse_order_for_last_run(\n            persist_data_dir_path: Path, job_name: str) -> Generator[Path, None, None]:\n        sorted_date_dirs = list(sorted(os.listdir(persist_data_dir_path)))\n        if len(sorted_date_dirs) > 0:\n            last_dir = sorted_date_dirs[-1]\n            last_dir_path = persist_data_dir_path.joinpath(last_dir)\n            for job_output_name in reversed(sorted(os.listdir(last_dir_path))):\n                name_part_of_filename = job_output_name[3:-7]\n                if name_part_of_filename == job_name:\n                    yield last_dir_path.joinpath(job_output_name)\n        else:\n            raise StopIteration\n\n    # TODO: Further refactor _deserialize_and_restore_outputs\n    def _deserialize_and_restore_outputs(self) -> Dataset:\n        persist_data_dir_path = Path(self._job_config.persist_data_dir_path)\n        if os.path.exists(persist_data_dir_path):\n            for tar_file_path in self._all_job_output_file_paths_in_reverse_order_for_last_run(\n                    persist_data_dir_path, self._job_name()):\n                with tarfile.open(tar_file_path, 'r:gz') as tarfile_obj:\n                    file_suffixes = set(fn.split('.')[-1] for fn in tarfile_obj.getnames())\n                if len(file_suffixes) != 1:\n                    self._log(f'Tar archive contains files with different or '\n                              f'no file suffixes: {file_suffixes}. Serializer '\n                              f'cannot be uniquely determined. Aborting '\n                              f'restore.')\n                else:\n                    file_suffix = file_suffixes.pop()\n                    serializers = self._serializer_registry.\\\n                        detect_tar_file_serializers_from_file_suffix(file_suffix)\n                    if len(serializers) == 0:\n                        self._log(f'No serializer for file suffix \"{file_suffix}\" can be'\n                                  f'determined. Aborting restore.')\n                    else:\n                        self._log(f'Reading dataset from a gzipped tarpack at'\n                                  f' \"{os.path.abspath(tar_file_path)}\"')\n\n                        serializer = serializers[0]\n                        with open(tar_file_path, 'rb') as tarfile_binary:\n                            dataset = serializer.deserialize(tarfile_binary.read())\n                        return_dataset_cls = cast(Type[Dataset], self._return_type)\n                        if return_dataset_cls().get_model_class() is dataset.get_model_class():\n                            return dataset\n                        else:\n                            try:\n                                new_dataset = return_dataset_cls()\n                                if new_dataset.get_model_class() is Model[str]:\n                                    new_dataset.from_data(dataset.to_json())\n                                else:\n                                    new_dataset.from_json(dataset.to_data())\n                                return new_dataset\n                            except Exception:\n                                return dataset\n\n        raise RuntimeError('No persisted output')\n
"},{"location":"reference/omnipy/compute/mixins/serialize/#omnipy.compute.mixins.serialize.SerializerFuncJobBaseMixin.persist_outputs","title":"persist_outputs: Optional[PersistOutputsOptions] property","text":""},{"location":"reference/omnipy/compute/mixins/serialize/#omnipy.compute.mixins.serialize.SerializerFuncJobBaseMixin.restore_outputs","title":"restore_outputs: Optional[RestoreOutputsOptions] property","text":""},{"location":"reference/omnipy/compute/mixins/serialize/#omnipy.compute.mixins.serialize.SerializerFuncJobBaseMixin.will_persist_outputs","title":"will_persist_outputs: PersistOutputsOptions property","text":""},{"location":"reference/omnipy/compute/mixins/serialize/#omnipy.compute.mixins.serialize.SerializerFuncJobBaseMixin.will_restore_outputs","title":"will_restore_outputs: RestoreOutputsOptions property","text":""},{"location":"reference/omnipy/compute/mixins/serialize/#omnipy.compute.mixins.serialize.SerializerFuncJobBaseMixin.__init__","title":"__init__(*, persist_outputs=None, restore_outputs=None)","text":"Source code in src/omnipy/compute/mixins/serialize.py
def __init__(self,\n             *,\n             persist_outputs: Optional[PersistOutputsOptions] = None,\n             restore_outputs: Optional[RestoreOutputsOptions] = None):\n\n    # TODO: Possibly reimplement logic using a state machine, e.g. \"transitions\" package\n    if persist_outputs is None:\n        self._persist_outputs = PersistOpts.FOLLOW_CONFIG if self._has_job_config else None\n    else:\n        self._persist_outputs = PersistOpts(persist_outputs)\n\n    if restore_outputs is None:\n        self._restore_outputs = RestoreOpts.FOLLOW_CONFIG if self._has_job_config else None\n    else:\n        self._restore_outputs = RestoreOpts(restore_outputs)\n\n    self._serializer_registry = self._create_serializer_registry()\n
"},{"location":"reference/omnipy/config/","title":"config","text":""},{"location":"reference/omnipy/config/engine/","title":"engine","text":""},{"location":"reference/omnipy/config/engine/#omnipy.config.engine.EngineConfig","title":"EngineConfig dataclass","text":"Source code in src/omnipy/config/engine.py
@dataclass\nclass EngineConfig:\n    ...\n
"},{"location":"reference/omnipy/config/engine/#omnipy.config.engine.LocalRunnerConfig","title":"LocalRunnerConfig dataclass","text":"

Bases: EngineConfig

Source code in src/omnipy/config/engine.py
@dataclass\nclass LocalRunnerConfig(EngineConfig):\n    ...\n
"},{"location":"reference/omnipy/config/engine/#omnipy.config.engine.PrefectEngineConfig","title":"PrefectEngineConfig dataclass","text":"

Bases: EngineConfig

Source code in src/omnipy/config/engine.py
@dataclass\nclass PrefectEngineConfig(EngineConfig):\n    use_cached_results: int = False\n
"},{"location":"reference/omnipy/config/engine/#omnipy.config.engine.PrefectEngineConfig.use_cached_results","title":"use_cached_results: int = False instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/job/","title":"job","text":""},{"location":"reference/omnipy/config/job/#omnipy.config.job.JobConfig","title":"JobConfig dataclass","text":"Source code in src/omnipy/config/job.py
@dataclass\nclass JobConfig:\n    persist_outputs: ConfigPersistOutputsOptions = \\\n        ConfigPersistOutputsOptions.ENABLE_FLOW_AND_TASK_OUTPUTS\n    restore_outputs: ConfigRestoreOutputsOptions = \\\n        ConfigRestoreOutputsOptions.DISABLED\n    persist_data_dir_path: str = field(default_factory=_get_persist_data_dir_path)\n
"},{"location":"reference/omnipy/config/job/#omnipy.config.job.JobConfig.persist_data_dir_path","title":"persist_data_dir_path: str = field(default_factory=_get_persist_data_dir_path) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/job/#omnipy.config.job.JobConfig.persist_outputs","title":"persist_outputs: ConfigPersistOutputsOptions = ConfigPersistOutputsOptions.ENABLE_FLOW_AND_TASK_OUTPUTS instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/job/#omnipy.config.job.JobConfig.restore_outputs","title":"restore_outputs: ConfigRestoreOutputsOptions = ConfigRestoreOutputsOptions.DISABLED instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/","title":"root_log","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig","title":"RootLogConfig dataclass","text":"Source code in src/omnipy/config/root_log.py
@dataclass\nclass RootLogConfig:\n    log_format_str: str = '{engine} {asctime} - {levelname}: {message} [{name}]'\n    locale: LocaleType = pkg_locale.getlocale()\n    log_to_stdout: bool = True\n    log_to_stderr: bool = True\n    log_to_file: bool = True\n    stdout_log_min_level: int = logging.INFO\n    stderr_log_min_level: int = logging.ERROR\n    file_log_min_level: int = logging.WARNING\n    file_log_dir_path: str = field(default_factory=_get_log_dir_path)\n
"},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.file_log_dir_path","title":"file_log_dir_path: str = field(default_factory=_get_log_dir_path) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.file_log_min_level","title":"file_log_min_level: int = logging.WARNING instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.locale","title":"locale: LocaleType = pkg_locale.getlocale() instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.log_format_str","title":"log_format_str: str = '{engine} {asctime} - {levelname}: {message} [{name}]' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.log_to_file","title":"log_to_file: bool = True instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.log_to_stderr","title":"log_to_stderr: bool = True instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.log_to_stdout","title":"log_to_stdout: bool = True instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.stderr_log_min_level","title":"stderr_log_min_level: int = logging.ERROR instance-attribute class-attribute","text":""},{"location":"reference/omnipy/config/root_log/#omnipy.config.root_log.RootLogConfig.stdout_log_min_level","title":"stdout_log_min_level: int = logging.INFO instance-attribute class-attribute","text":""},{"location":"reference/omnipy/data/","title":"data","text":""},{"location":"reference/omnipy/data/dataset/","title":"dataset","text":""},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.DATA_KEY","title":"DATA_KEY = 'data' module-attribute","text":""},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.ModelT","title":"ModelT = TypeVar('ModelT', bound=Model) module-attribute","text":""},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Undefined","title":"Undefined = object() module-attribute","text":""},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset","title":"Dataset","text":"

Bases: GenericModel, Generic[ModelT], UserDict

Dict-based container of data files that follow a specific Model

Dataset is a generic class that cannot be instantiated directly. Instead, a Dataset class needs to be specialized with a data model before Dataset objects can be instantiated. A data model functions as a data parser and guarantees that the parsed data follows the specified model.

The specialization must be done through the use of Model, either directly, e.g.::

MyDataset = Dataset[Model[Dict[str, List[int]]])\n

... or indirectly, using a Model subclass, e.g.::

class MyModel(Model[Dict[str, List[int]]):\n    pass\n\nMyDataset = Dataset[MyModel]\n

... alternatively through the specification of a Dataset subclass::

class MyDataset(Dataset[MyModel]):\n    pass\n

The specialization can also be done in a more deeply nested structure, e.g.::

class MyNumberList(Model[List[int]]):\n    pass\n\nclass MyToplevelDict(Model[Dict[str, MyNumberList]]):\n    pass\n\nclass MyDataset(Dataset[MyToplevelDict]):\n    pass\n

Once instantiated, a dataset object functions as a dict of data files, with the keys referring to the data file names and the contents to the data file contents, e.g.::

MyNumberListDataset = Dataset[Model[List[int]]]\n\nmy_dataset = MyNumberListDataset({'file_1': [1,2,3]})\nmy_dataset['file_2'] = [2,3,4]\n\nprint(my_dataset.keys())\n

The Dataset class is a wrapper class around the powerful GenericModel class from pydantic.

Source code in src/omnipy/data/dataset.py
class Dataset(GenericModel, Generic[ModelT], UserDict):\n\"\"\"\n    Dict-based container of data files that follow a specific Model\n\n    Dataset is a generic class that cannot be instantiated directly. Instead, a Dataset class needs\n    to be specialized with a data model before Dataset objects can be instantiated. A data model\n    functions as a data parser and guarantees that the parsed data follows the specified model.\n\n    The specialization must be done through the use of Model, either directly, e.g.::\n\n        MyDataset = Dataset[Model[Dict[str, List[int]]])\n\n    ... or indirectly, using a Model subclass, e.g.::\n\n        class MyModel(Model[Dict[str, List[int]]):\n            pass\n\n        MyDataset = Dataset[MyModel]\n\n    ... alternatively through the specification of a Dataset subclass::\n\n        class MyDataset(Dataset[MyModel]):\n            pass\n\n    The specialization can also be done in a more deeply nested structure, e.g.::\n\n        class MyNumberList(Model[List[int]]):\n            pass\n\n        class MyToplevelDict(Model[Dict[str, MyNumberList]]):\n            pass\n\n        class MyDataset(Dataset[MyToplevelDict]):\n            pass\n\n    Once instantiated, a dataset object functions as a dict of data files, with the keys\n    referring to the data file names and the contents to the data file contents, e.g.::\n\n        MyNumberListDataset = Dataset[Model[List[int]]]\n\n        my_dataset = MyNumberListDataset({'file_1': [1,2,3]})\n        my_dataset['file_2'] = [2,3,4]\n\n        print(my_dataset.keys())\n\n    The Dataset class is a wrapper class around the powerful `GenericModel` class from pydantic.\n    \"\"\"\n    class Config:\n        validate_assignment = True\n        # json_loads = orjson.loads\n        # json_dumps = orjson_dumps\n\n    data: Dict[str, ModelT] = Field(default={})\n\n    def __class_getitem__(cls, model: ModelT) -> ModelT:\n        # TODO: change model type to params: Union[Type[Any], Tuple[Type[Any], ...]]\n        #       as in GenericModel.\n\n        # For now, only singular model types are allowed. These lines are needed for\n        # interoperability with pydantic GenericModel, which internally stores the model\n        # as a tuple:\n        if isinstance(model, tuple) and len(model) == 1:\n            model = model[0]\n\n        if not isinstance(model, TypeVar) and not lenient_issubclass(model, Model):\n            raise TypeError('Invalid model: {}! '.format(model)\n                            + 'omnipy Dataset models must be a specialization of the omnipy '\n                            'Model class.')\n        return super().__class_getitem__(model)\n\n    def __init__(self,\n                 value: Union[Dict[str, Any], Iterator[Tuple[str, Any]]] = Undefined,\n                 **input_data: Any) -> None:\n        # TODO: Error message when forgetting parenthesis when creating Dataset should be improved.\n        #       Unclear where this can be done, if anywhere? E.g.:\n        #           a = Dataset[Model[int]]\n        #           a['adsfas'] = 2\n        #           Traceback (most recent call last):\n        #             ...\n        #           TypeError: 'ModelMetaclass' object does not support item assignment\n\n        if value != Undefined:\n            input_data[DATA_KEY] = value\n\n        if self.get_model_class() == ModelT:\n            self._raise_no_model_exception()\n\n        GenericModel.__init__(self, **input_data)\n        UserDict.__init__(self, self.data)  # noqa\n        if not self.__doc__:\n            self._set_standard_field_description()\n\n    def get_model_class(self) -> Type[Model]:\n\"\"\"\n        Returns the concrete Model class used for all data files in the dataset, e.g.:\n        `Model[List[int]]`\n        :return: The concrete Model class used for all data files in the dataset\n        \"\"\"\n        return self.__fields__.get(DATA_KEY).type_\n\n    # TODO: Update _raise_no_model_exception() text. Model is now a requirement\n\n    @staticmethod\n    def _raise_no_model_exception() -> None:\n        raise TypeError(\n            'Note: The Dataset class requires a concrete model to be specified as '\n            'a type hierarchy within brackets either directly, e.g.:\\n\\n'\n            '\\tmodel = Dataset[List[int]]()\\n\\n'\n            'or indirectly in a subclass definition, e.g.:\\n\\n'\n            '\\tclass MyNumberListDataset(Dataset[List[int]]): ...\\n\\n'\n            'In both cases, the use of the Model class or a subclass is encouraged if anything '\n            'other than the simplest cases, e.g.:\\n\\n'\n            '\\tclass MyNumberListModel(Model[List[int]]): ...\\n'\n            '\\tclass MyDataset(Dataset[MyNumberListModel]): ...\\n\\n'\n            'Usage of Dataset without a type specification results in this exception. '\n            'Similar use of the Model class do not currently result in an exception, only '\n            'a warning message the first time this is done. However, this is just a '\n            '\"poor man\\'s exception\" due to complex technicalities in that class. Please '\n            'explicitly specify types in both cases. ')\n\n    def _set_standard_field_description(self) -> None:\n        self.__fields__[DATA_KEY].field_info.description = self._get_standard_field_description()\n\n    @classmethod\n    def _get_standard_field_description(cls) -> str:\n        return ('This class represents a data in the `omnipy` Python package and contains '\n                'a set of named data items that follows the same data model. '\n                'It is a statically typed specialization of the Dataset class according to a '\n                'particular specialization of the Model class. Both main classes are wrapping '\n                'the excellent Python package named `pydantic`.')\n\n    def __setitem__(self, obj_type: str, data_obj: Any) -> None:\n        has_prev_value = obj_type in self.data\n        prev_value = self.data.get(obj_type)\n\n        try:\n            self.data[obj_type] = data_obj\n            self._validate(obj_type)\n        except:  # noqa\n            if has_prev_value:\n                self.data[obj_type] = prev_value\n            else:\n                del self.data[obj_type]\n            raise\n\n    def __getitem__(self, obj_type: str) -> Any:\n        if obj_type in self.data:\n            return self.data[obj_type].contents\n        else:\n            return self.data[obj_type]\n\n    def _validate(self, _obj_type: str) -> None:\n        self.data = self.data  # Triggers pydantic validation, as validate_assignment=True\n\n    def __iter__(self) -> Iterator:\n        return UserDict.__iter__(self)\n\n    def __setattr__(self, attr: str, value: Any) -> None:\n        if attr in self.__dict__ or attr == DATA_KEY or attr.startswith('__'):\n            super().__setattr__(attr, value)\n        else:\n            raise RuntimeError('Model does not allow setting of extra attributes')\n\n    def to_data(self) -> Dict[str, Any]:\n        return GenericModel.dict(self).get(DATA_KEY)\n\n    def from_data(self,\n                  data: Union[Dict[str, Any], Iterator[Tuple[str, Any]]],\n                  update: bool = True) -> None:\n        if not isinstance(data, dict):\n            data = dict(data)\n\n        if not update:\n            self.clear()\n\n        for obj_type, obj_val in data.items():\n            new_model = self.get_model_class()()  # noqa\n            new_model.from_data(obj_val)\n            self[obj_type] = new_model\n\n    def to_json(self, pretty=False) -> Dict[str, str]:\n        result = {}\n\n        for key, val in self.to_data().items():\n            result[key] = self._pretty_print_json(val) if pretty else json.dumps(val)\n        return result\n\n    def from_json(self,\n                  data: Union[Dict[str, str], Iterator[Tuple[str, str]]],\n                  update: bool = True) -> None:\n        if not isinstance(data, dict):\n            data = dict(data)\n\n        if not update:\n            self.clear()\n\n        for obj_type, obj_val in data.items():\n            new_model = self.get_model_class()()  # noqa\n            new_model.from_json(obj_val)\n            self[obj_type] = new_model\n\n    # @classmethod\n    # def get_type_args(cls):\n    #     return cls.__fields__.get(DATA_KEY).type_\n    #\n    #\n    # @classmethod\n    # def create_from_json(cls, data: Union[str, Tuple[str]]):\n    #     if isinstance(data, tuple):\n    #         data = data[0]\n    #\n    #     obj = cls()\n    #     obj.from_json(data, update=False)\n    #     return obj\n    #\n    # def __reduce__(self):\n    #     return self.__class__.create_from_json, (self.to_json(),)\n\n    @classmethod\n    def to_json_schema(cls, pretty=False) -> Union[str, Dict[str, str]]:\n        result = {}\n        schema = cls.schema()\n        for key, val in schema['properties']['data'].items():\n            result[key] = val\n        result['title'] = schema['title']\n        result['definitions'] = schema['definitions']\n        if pretty:\n            return cls._pretty_print_json(result)\n        else:\n            return json.dumps(result)\n\n    @staticmethod\n    def _pretty_print_json(json_content: Any) -> str:\n        return json.dumps(json_content, indent=4)\n\n    def as_multi_model_dataset(self) -> MultiModelDataset[ModelT]:\n        multi_model_dataset = MultiModelDataset[self.get_model_class()]()\n        for obj_type in self:\n            multi_model_dataset.data[obj_type] = self.data[obj_type]\n        return multi_model_dataset\n\n    def __eq__(self, other: object) -> bool:\n        return self.__class__ == other.__class__ and super().__eq__(other)\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.data","title":"data: Dict[str, ModelT] = Field(default={}) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.Config","title":"Config","text":"Source code in src/omnipy/data/dataset.py
class Config:\n    validate_assignment = True\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.Config.validate_assignment","title":"validate_assignment = True instance-attribute class-attribute","text":""},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.__class_getitem__","title":"__class_getitem__(model)","text":"Source code in src/omnipy/data/dataset.py
def __class_getitem__(cls, model: ModelT) -> ModelT:\n    # TODO: change model type to params: Union[Type[Any], Tuple[Type[Any], ...]]\n    #       as in GenericModel.\n\n    # For now, only singular model types are allowed. These lines are needed for\n    # interoperability with pydantic GenericModel, which internally stores the model\n    # as a tuple:\n    if isinstance(model, tuple) and len(model) == 1:\n        model = model[0]\n\n    if not isinstance(model, TypeVar) and not lenient_issubclass(model, Model):\n        raise TypeError('Invalid model: {}! '.format(model)\n                        + 'omnipy Dataset models must be a specialization of the omnipy '\n                        'Model class.')\n    return super().__class_getitem__(model)\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.__eq__","title":"__eq__(other)","text":"Source code in src/omnipy/data/dataset.py
def __eq__(self, other: object) -> bool:\n    return self.__class__ == other.__class__ and super().__eq__(other)\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.__getitem__","title":"__getitem__(obj_type)","text":"Source code in src/omnipy/data/dataset.py
def __getitem__(self, obj_type: str) -> Any:\n    if obj_type in self.data:\n        return self.data[obj_type].contents\n    else:\n        return self.data[obj_type]\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.__init__","title":"__init__(value=Undefined, **input_data)","text":"Source code in src/omnipy/data/dataset.py
def __init__(self,\n             value: Union[Dict[str, Any], Iterator[Tuple[str, Any]]] = Undefined,\n             **input_data: Any) -> None:\n    # TODO: Error message when forgetting parenthesis when creating Dataset should be improved.\n    #       Unclear where this can be done, if anywhere? E.g.:\n    #           a = Dataset[Model[int]]\n    #           a['adsfas'] = 2\n    #           Traceback (most recent call last):\n    #             ...\n    #           TypeError: 'ModelMetaclass' object does not support item assignment\n\n    if value != Undefined:\n        input_data[DATA_KEY] = value\n\n    if self.get_model_class() == ModelT:\n        self._raise_no_model_exception()\n\n    GenericModel.__init__(self, **input_data)\n    UserDict.__init__(self, self.data)  # noqa\n    if not self.__doc__:\n        self._set_standard_field_description()\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.__iter__","title":"__iter__()","text":"Source code in src/omnipy/data/dataset.py
def __iter__(self) -> Iterator:\n    return UserDict.__iter__(self)\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.__setattr__","title":"__setattr__(attr, value)","text":"Source code in src/omnipy/data/dataset.py
def __setattr__(self, attr: str, value: Any) -> None:\n    if attr in self.__dict__ or attr == DATA_KEY or attr.startswith('__'):\n        super().__setattr__(attr, value)\n    else:\n        raise RuntimeError('Model does not allow setting of extra attributes')\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.__setitem__","title":"__setitem__(obj_type, data_obj)","text":"Source code in src/omnipy/data/dataset.py
def __setitem__(self, obj_type: str, data_obj: Any) -> None:\n    has_prev_value = obj_type in self.data\n    prev_value = self.data.get(obj_type)\n\n    try:\n        self.data[obj_type] = data_obj\n        self._validate(obj_type)\n    except:  # noqa\n        if has_prev_value:\n            self.data[obj_type] = prev_value\n        else:\n            del self.data[obj_type]\n        raise\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.as_multi_model_dataset","title":"as_multi_model_dataset()","text":"Source code in src/omnipy/data/dataset.py
def as_multi_model_dataset(self) -> MultiModelDataset[ModelT]:\n    multi_model_dataset = MultiModelDataset[self.get_model_class()]()\n    for obj_type in self:\n        multi_model_dataset.data[obj_type] = self.data[obj_type]\n    return multi_model_dataset\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.from_data","title":"from_data(data, update=True)","text":"Source code in src/omnipy/data/dataset.py
def from_data(self,\n              data: Union[Dict[str, Any], Iterator[Tuple[str, Any]]],\n              update: bool = True) -> None:\n    if not isinstance(data, dict):\n        data = dict(data)\n\n    if not update:\n        self.clear()\n\n    for obj_type, obj_val in data.items():\n        new_model = self.get_model_class()()  # noqa\n        new_model.from_data(obj_val)\n        self[obj_type] = new_model\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.from_json","title":"from_json(data, update=True)","text":"Source code in src/omnipy/data/dataset.py
def from_json(self,\n              data: Union[Dict[str, str], Iterator[Tuple[str, str]]],\n              update: bool = True) -> None:\n    if not isinstance(data, dict):\n        data = dict(data)\n\n    if not update:\n        self.clear()\n\n    for obj_type, obj_val in data.items():\n        new_model = self.get_model_class()()  # noqa\n        new_model.from_json(obj_val)\n        self[obj_type] = new_model\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.get_model_class","title":"get_model_class()","text":"

Returns the concrete Model class used for all data files in the dataset, e.g.: Model[List[int]] :return: The concrete Model class used for all data files in the dataset

Source code in src/omnipy/data/dataset.py
def get_model_class(self) -> Type[Model]:\n\"\"\"\n    Returns the concrete Model class used for all data files in the dataset, e.g.:\n    `Model[List[int]]`\n    :return: The concrete Model class used for all data files in the dataset\n    \"\"\"\n    return self.__fields__.get(DATA_KEY).type_\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.to_data","title":"to_data()","text":"Source code in src/omnipy/data/dataset.py
def to_data(self) -> Dict[str, Any]:\n    return GenericModel.dict(self).get(DATA_KEY)\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.to_json","title":"to_json(pretty=False)","text":"Source code in src/omnipy/data/dataset.py
def to_json(self, pretty=False) -> Dict[str, str]:\n    result = {}\n\n    for key, val in self.to_data().items():\n        result[key] = self._pretty_print_json(val) if pretty else json.dumps(val)\n    return result\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.Dataset.to_json_schema","title":"to_json_schema(pretty=False) classmethod","text":"Source code in src/omnipy/data/dataset.py
@classmethod\ndef to_json_schema(cls, pretty=False) -> Union[str, Dict[str, str]]:\n    result = {}\n    schema = cls.schema()\n    for key, val in schema['properties']['data'].items():\n        result[key] = val\n    result['title'] = schema['title']\n    result['definitions'] = schema['definitions']\n    if pretty:\n        return cls._pretty_print_json(result)\n    else:\n        return json.dumps(result)\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.MultiModelDataset","title":"MultiModelDataset","text":"

Bases: Dataset[ModelT], Generic[ModelT]

Variant of Dataset that allows custom models to be set on individual data files

Note that the general model still needs to hold for all data files, in addition to any custom models.

Source code in src/omnipy/data/dataset.py
class MultiModelDataset(Dataset[ModelT], Generic[ModelT]):\n\"\"\"\n        Variant of Dataset that allows custom models to be set on individual data files\n\n        Note that the general model still needs to hold for all data files, in addition to any\n        custom models.\n    \"\"\"\n\n    _custom_field_models: Dict[str, ModelT] = PrivateAttr(default={})\n\n    def set_model(self, obj_type: str, model: ModelT) -> None:\n        try:\n            self._custom_field_models[obj_type] = model\n            if obj_type in self.data:\n                self._validate(obj_type)\n            else:\n                self.data[obj_type] = model()\n        except ValidationError:\n            del self._custom_field_models[obj_type]\n            raise\n\n    def get_model(self, obj_type: str) -> ModelT:\n        if obj_type in self._custom_field_models:\n            return self._custom_field_models[obj_type]\n        else:\n            return self.get_model_class()\n\n    def _validate(self, obj_type: str) -> None:\n        if obj_type in self._custom_field_models:\n            model = self._custom_field_models[obj_type]\n            if not isinstance(model, Model):\n                model = Model[model]\n            data_obj = self._to_data_if_model(self.data[obj_type])\n            parsed_data = self._to_data_if_model(model(data_obj))\n            self.data[obj_type] = parsed_data\n        super()._validate(obj_type)  # validates all data according to ModelT\n\n    @staticmethod\n    def _to_data_if_model(data_obj: Any):\n        if isinstance(data_obj, Model):\n            data_obj = data_obj.to_data()\n        return data_obj\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.MultiModelDataset.get_model","title":"get_model(obj_type)","text":"Source code in src/omnipy/data/dataset.py
def get_model(self, obj_type: str) -> ModelT:\n    if obj_type in self._custom_field_models:\n        return self._custom_field_models[obj_type]\n    else:\n        return self.get_model_class()\n
"},{"location":"reference/omnipy/data/dataset/#omnipy.data.dataset.MultiModelDataset.set_model","title":"set_model(obj_type, model)","text":"Source code in src/omnipy/data/dataset.py
def set_model(self, obj_type: str, model: ModelT) -> None:\n    try:\n        self._custom_field_models[obj_type] = model\n        if obj_type in self.data:\n            self._validate(obj_type)\n        else:\n            self.data[obj_type] = model()\n    except ValidationError:\n        del self._custom_field_models[obj_type]\n        raise\n
"},{"location":"reference/omnipy/data/model/","title":"model","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.ROOT_KEY","title":"ROOT_KEY = '__root__' module-attribute","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.RootT","title":"RootT = TypeVar('RootT') module-attribute","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model","title":"Model","text":"

Bases: GenericModel, Generic[RootT]

A data model containing a value parsed according to the model.

If no value is provided, the value is set to the default value of the data model, found by calling the model class without parameters, e.g. int().

Model is a generic class that cannot be instantiated directly. Instead, a Model class needs to be specialized with a data type before Model objects can be instantiated. A data model functions as a data parser and guarantees that the parsed data follows the specified model.

Example data model specialized as a class alias::

MyNumberList = Model[List[int]]\n

... alternatively as a Model subclass::

class MyNumberList(Model[List[int]]):\n    pass\n

Once instantiated, a Model object functions as a parser, e.g.::

my_number_list = MyNumberList([2,3,4])\n\nmy_number_list.contents = ['3', 4, True]\nassert my_number_list.contents == [3,4,1]\n

While the following should raise a ValidationError::

my_number_list.contents = ['abc', 'def']\n

The Model class is a wrapper class around the powerful GenericModel class from pydantic.

See also docs of the Dataset class for more usage examples.

Source code in src/omnipy/data/model.py
class Model(GenericModel, Generic[RootT]):\n\"\"\"\n    A data model containing a value parsed according to the model.\n\n    If no value is provided, the value is set to the default value of the data model, found by\n    calling the model class without parameters, e.g. `int()`.\n\n    Model is a generic class that cannot be instantiated directly. Instead, a Model class needs\n    to be specialized with a data type before Model objects can be instantiated. A data model\n    functions as a data parser and guarantees that the parsed data follows the specified model.\n\n    Example data model specialized as a class alias::\n\n        MyNumberList = Model[List[int]]\n\n    ... alternatively as a Model subclass::\n\n        class MyNumberList(Model[List[int]]):\n            pass\n\n    Once instantiated, a Model object functions as a parser, e.g.::\n\n        my_number_list = MyNumberList([2,3,4])\n\n        my_number_list.contents = ['3', 4, True]\n        assert my_number_list.contents == [3,4,1]\n\n    While the following should raise a `ValidationError`::\n\n        my_number_list.contents = ['abc', 'def']\n\n    The Model class is a wrapper class around the powerful `GenericModel` class from pydantic.\n\n    See also docs of the Dataset class for more usage examples.\n    \"\"\"\n\n    __root__: RootT\n\n    class Config:\n        arbitrary_types_allowed = True\n        validate_all = True\n        validate_assignment = True\n        smart_union = True\n        # json_loads = orjson.loads\n        # json_dumps = orjson_dumps\n\n    @classmethod\n    def _get_default_value_from_model(cls, model: Type[RootT]) -> RootT:\n        if isinstance(model, TypeVar):\n            if model.__bound__ is None:  # noqa\n                raise TypeError('The TypeVar \"{}\" needs to be bound to a '.format(model.__name__)\n                                + 'type that provides a default value when called')\n            else:\n                model = model.__bound__  # noqa\n        origin_type = get_origin(model)\n        args = get_args(model)\n\n        if origin_type in (None, ()):\n            origin_type = model\n\n        if origin_type is Union:\n            if NoneType in args:\n                return None\n            for arg in args:\n                if callable(arg):\n                    return cls._get_default_value_from_model(arg)\n        elif origin_type is tuple:\n            if args and Ellipsis not in args:\n                return tuple(cls._get_default_value_from_model(arg) for arg in args)\n\n        return origin_type()\n\n    @classmethod\n    def _populate_root_field(cls, model: Type[RootT]) -> None:\n        default_val = cls._get_default_value_from_model(model)\n\n        def get_default_val() -> RootT:\n            return default_val\n\n        if ROOT_KEY in cls.__config__.fields:\n            cls.__config__.fields[ROOT_KEY]['default_factory'] = get_default_val\n        else:\n            cls.__config__.fields[ROOT_KEY] = {'default_factory': get_default_val}\n\n        data_field = ModelField.infer(\n            name=ROOT_KEY,\n            value=Undefined,\n            annotation=model,\n            class_validators=None,\n            config=cls.__config__)\n\n        cls.__fields__[ROOT_KEY] = data_field\n        cls.__annotations__[ROOT_KEY] = model\n\n    @classmethod\n    def _depopulate_root_field(cls):\n        del cls.__config__.fields[ROOT_KEY]\n        del cls.__fields__[ROOT_KEY]\n        del cls.__annotations__[ROOT_KEY]\n\n    def __class_getitem__(cls, model: Union[Type[RootT], TypeVar]) -> Union[Type[RootT], TypeVar]:\n        # TODO: change model type to params: Union[Type[Any], Tuple[Type[Any], ...]]\n        #       as in GenericModel\n\n        # For now, only singular model types are allowed. These lines are needed for\n        # interoperability with pydantic GenericModel, which internally stores the model\n        # as a tuple:\n        if isinstance(model, tuple) and len(model) == 1:\n            model = model[0]\n\n        # Populating the root field at runtime instead of providing a __root__ Field explicitly\n        # is needed due to the inability of typing/pydantic to provide a dynamic default based on\n        # the actual type. The following issue in mypy seems relevant:\n        # https://github.com/python/mypy/issues/3737 (as well as linked issues)\n        if cls == Model:  # Only for the base Model class\n            cls._populate_root_field(model)\n\n        created_model = super().__class_getitem__(model)\n\n        # As long as models are not created concurrently, setting the class members temporarily\n        # should not have averse effects\n        # TODO: Check if we can move to explicit definition of __root__ field at the object\n        #       level in pydantic 2.0 (when it is released)\n        if cls == Model:\n            cls._depopulate_root_field()\n\n        return created_model\n\n    def __new__(cls, value: Union[RootT, UndefinedType] = Undefined, **kwargs):\n        model_not_specified = ROOT_KEY not in cls.__fields__\n        if model_not_specified:\n            cls._raise_no_model_exception()\n        return super().__new__(cls)\n\n    def __init__(\n        self,\n        value: Union[RootT, UndefinedType] = Undefined,\n        /,\n        __root__: Union[RootT, UndefinedType] = Undefined,\n        **data: object,\n    ) -> None:\n        super_data: Dict[str, RootT] = {}\n        num_root_vals = 0\n\n        if value is not Undefined:\n            super_data[ROOT_KEY] = value\n            num_root_vals += 1\n\n        if __root__ is not Undefined:\n            super_data[ROOT_KEY] = __root__\n            num_root_vals += 1\n\n        if data:\n            super_data[ROOT_KEY] = data\n            num_root_vals += 1\n\n        assert num_root_vals <= 1\n\n        super().__init__(**super_data)\n\n        if not self.__class__.__doc__:\n            self._set_standard_field_description()\n\n    @staticmethod\n    def _raise_no_model_exception() -> None:\n        raise TypeError('Note: The Model class requires a concrete model to be specified as '\n                        'a type hierarchy within brackets either directly, e.g.:\\n\\n'\n                        '\\tmodel = Model[List[int]]([1,2,3])\\n\\n'\n                        'or indirectly in a subclass definition, e.g.:\\n\\n'\n                        '\\tclass MyNumberList(Model[List[int]]): ...\\n\\n')\n\n    def _set_standard_field_description(self) -> None:\n        self.__fields__[ROOT_KEY].field_info.description = self._get_standard_field_description()\n\n    @classmethod\n    def _get_standard_field_description(cls) -> str:\n        return ('This class represents a concrete model for data items in the `omnipy` Python '\n                'package. It is a statically typed specialization of the Model class, '\n                'which is itself wrapping the excellent Python package named `pydantic`.')\n\n    @classmethod\n    def _parse_data(cls, data: RootT) -> Any:\n        return data\n\n    @root_validator\n    def _parse_root_object(cls, root_obj: RootT) -> Any:  # noqa\n        if ROOT_KEY not in root_obj:\n            return root_obj\n        else:\n            return {ROOT_KEY: cls._parse_data(root_obj[ROOT_KEY])}\n\n    @property\n    def contents(self) -> Any:\n        return self.__dict__.get(ROOT_KEY)\n\n    @contents.setter\n    def contents(self, value: RootT) -> None:\n        super().__setattr__(ROOT_KEY, value)\n\n    def to_data(self) -> Any:\n        return self.dict()[ROOT_KEY]\n\n    def from_data(self, value: Any) -> None:\n        self.contents = value\n\n    def to_json(self, pretty=False) -> str:\n        json_content = self.json()\n        if pretty:\n            return self._pretty_print_json(json.loads(json_content))\n        else:\n            return json_content\n\n    def from_json(self, json_contents: str) -> None:\n        new_model = self.parse_raw(json_contents, proto=Protocol.json)\n        self._set_contents_without_validation(new_model)\n\n    # @classmethod\n    # def get_type_args(cls):\n    #     return cls.__fields__.get(ROOT_KEY).type_\n    #\n    # @classmethod\n    # def create_from_json(cls, data: Union[str, Tuple[str]]):\n    #     if isinstance(data, tuple):\n    #         data = data[0]\n    #\n    #     obj = cls()\n    #     obj.from_json(data)\n    #     return obj\n    #\n    # def __reduce__(self):\n    #     return self.__class__.create_from_json, (self.to_json(),)\n\n    def _set_contents_without_validation(self, contents: RootT) -> None:\n        validate_assignment = self.__config__.validate_assignment\n        self.__config__.validate_assignment = False\n        self.contents = contents.contents\n        self.__config__.validate_assignment = validate_assignment\n\n    @classmethod\n    def to_json_schema(cls, pretty=False) -> str:\n        schema = cls.schema()\n\n        if pretty:\n            return cls._pretty_print_json(schema)\n        else:\n            return json.dumps(schema)\n\n    @staticmethod\n    def _pretty_print_json(json_content: Any) -> str:\n        return json.dumps(json_content, indent=4)\n\n    def _check_for_root_key(self) -> None:\n        if ROOT_KEY not in self.__dict__:\n            raise TypeError('The Model class requires the specific model to be specified in as '\n                            'a type hierarchy within brackets either directly, e.g.:\\n'\n                            '\\t\"model = Model[List[int]]([1,2,3])\"\\n'\n                            'or indirectly in a subclass definition, e.g.:\\n'\n                            '\\t\"class MyNumberList(Model[List[int]]): ...\"')\n\n    def __setattr__(self, attr: str, value: Any) -> None:\n        if attr in self.__dict__ and attr not in [ROOT_KEY]:\n            super().__setattr__(attr, value)\n        else:\n            if attr in ['contents']:\n                contents_prop = getattr(self.__class__, attr)\n                contents_prop.__set__(self, value)\n            else:\n                raise RuntimeError('Model does not allow setting of extra attributes')\n\n    # TODO: Update Dataset.__eq__ similarly, with tests\n    def __eq__(self, other: object) -> bool:\n        return self.__class__ == other.__class__ and super().__eq__(other)\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.__root__","title":"__root__: RootT instance-attribute","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.contents","title":"contents: Any property writable","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.Config","title":"Config","text":"Source code in src/omnipy/data/model.py
class Config:\n    arbitrary_types_allowed = True\n    validate_all = True\n    validate_assignment = True\n    smart_union = True\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.Config.arbitrary_types_allowed","title":"arbitrary_types_allowed = True instance-attribute class-attribute","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.Config.smart_union","title":"smart_union = True instance-attribute class-attribute","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.Config.validate_all","title":"validate_all = True instance-attribute class-attribute","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.Config.validate_assignment","title":"validate_assignment = True instance-attribute class-attribute","text":""},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.__class_getitem__","title":"__class_getitem__(model)","text":"Source code in src/omnipy/data/model.py
def __class_getitem__(cls, model: Union[Type[RootT], TypeVar]) -> Union[Type[RootT], TypeVar]:\n    # TODO: change model type to params: Union[Type[Any], Tuple[Type[Any], ...]]\n    #       as in GenericModel\n\n    # For now, only singular model types are allowed. These lines are needed for\n    # interoperability with pydantic GenericModel, which internally stores the model\n    # as a tuple:\n    if isinstance(model, tuple) and len(model) == 1:\n        model = model[0]\n\n    # Populating the root field at runtime instead of providing a __root__ Field explicitly\n    # is needed due to the inability of typing/pydantic to provide a dynamic default based on\n    # the actual type. The following issue in mypy seems relevant:\n    # https://github.com/python/mypy/issues/3737 (as well as linked issues)\n    if cls == Model:  # Only for the base Model class\n        cls._populate_root_field(model)\n\n    created_model = super().__class_getitem__(model)\n\n    # As long as models are not created concurrently, setting the class members temporarily\n    # should not have averse effects\n    # TODO: Check if we can move to explicit definition of __root__ field at the object\n    #       level in pydantic 2.0 (when it is released)\n    if cls == Model:\n        cls._depopulate_root_field()\n\n    return created_model\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.__eq__","title":"__eq__(other)","text":"Source code in src/omnipy/data/model.py
def __eq__(self, other: object) -> bool:\n    return self.__class__ == other.__class__ and super().__eq__(other)\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.__init__","title":"__init__(value=Undefined, /, __root__=Undefined, **data)","text":"Source code in src/omnipy/data/model.py
def __init__(\n    self,\n    value: Union[RootT, UndefinedType] = Undefined,\n    /,\n    __root__: Union[RootT, UndefinedType] = Undefined,\n    **data: object,\n) -> None:\n    super_data: Dict[str, RootT] = {}\n    num_root_vals = 0\n\n    if value is not Undefined:\n        super_data[ROOT_KEY] = value\n        num_root_vals += 1\n\n    if __root__ is not Undefined:\n        super_data[ROOT_KEY] = __root__\n        num_root_vals += 1\n\n    if data:\n        super_data[ROOT_KEY] = data\n        num_root_vals += 1\n\n    assert num_root_vals <= 1\n\n    super().__init__(**super_data)\n\n    if not self.__class__.__doc__:\n        self._set_standard_field_description()\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.__new__","title":"__new__(value=Undefined, **kwargs)","text":"Source code in src/omnipy/data/model.py
def __new__(cls, value: Union[RootT, UndefinedType] = Undefined, **kwargs):\n    model_not_specified = ROOT_KEY not in cls.__fields__\n    if model_not_specified:\n        cls._raise_no_model_exception()\n    return super().__new__(cls)\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.__setattr__","title":"__setattr__(attr, value)","text":"Source code in src/omnipy/data/model.py
def __setattr__(self, attr: str, value: Any) -> None:\n    if attr in self.__dict__ and attr not in [ROOT_KEY]:\n        super().__setattr__(attr, value)\n    else:\n        if attr in ['contents']:\n            contents_prop = getattr(self.__class__, attr)\n            contents_prop.__set__(self, value)\n        else:\n            raise RuntimeError('Model does not allow setting of extra attributes')\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.from_data","title":"from_data(value)","text":"Source code in src/omnipy/data/model.py
def from_data(self, value: Any) -> None:\n    self.contents = value\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.from_json","title":"from_json(json_contents)","text":"Source code in src/omnipy/data/model.py
def from_json(self, json_contents: str) -> None:\n    new_model = self.parse_raw(json_contents, proto=Protocol.json)\n    self._set_contents_without_validation(new_model)\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.to_data","title":"to_data()","text":"Source code in src/omnipy/data/model.py
def to_data(self) -> Any:\n    return self.dict()[ROOT_KEY]\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.to_json","title":"to_json(pretty=False)","text":"Source code in src/omnipy/data/model.py
def to_json(self, pretty=False) -> str:\n    json_content = self.json()\n    if pretty:\n        return self._pretty_print_json(json.loads(json_content))\n    else:\n        return json_content\n
"},{"location":"reference/omnipy/data/model/#omnipy.data.model.Model.to_json_schema","title":"to_json_schema(pretty=False) classmethod","text":"Source code in src/omnipy/data/model.py
@classmethod\ndef to_json_schema(cls, pretty=False) -> str:\n    schema = cls.schema()\n\n    if pretty:\n        return cls._pretty_print_json(schema)\n    else:\n        return json.dumps(schema)\n
"},{"location":"reference/omnipy/data/serializer/","title":"serializer","text":""},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.Serializer","title":"Serializer","text":"

Bases: ABC

Source code in src/omnipy/data/serializer.py
class Serializer(ABC):\n\"\"\"\"\"\"\n    @classmethod\n    @abstractmethod\n    def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:\n        pass\n\n    @classmethod\n    @abstractmethod\n    def get_dataset_cls_for_new(cls) -> Type[Dataset]:\n        pass\n\n    @classmethod\n    @abstractmethod\n    def get_output_file_suffix(cls) -> str:\n        pass\n\n    @classmethod\n    @abstractmethod\n    def serialize(cls, dataset: Dataset) -> Union[bytes, memoryview]:\n        pass\n\n    @classmethod\n    @abstractmethod\n    def deserialize(cls, serialized: bytes) -> Dataset:\n        pass\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.Serializer.deserialize","title":"deserialize(serialized) classmethod abstractmethod","text":"Source code in src/omnipy/data/serializer.py
@classmethod\n@abstractmethod\ndef deserialize(cls, serialized: bytes) -> Dataset:\n    pass\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.Serializer.get_dataset_cls_for_new","title":"get_dataset_cls_for_new() classmethod abstractmethod","text":"Source code in src/omnipy/data/serializer.py
@classmethod\n@abstractmethod\ndef get_dataset_cls_for_new(cls) -> Type[Dataset]:\n    pass\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.Serializer.get_output_file_suffix","title":"get_output_file_suffix() classmethod abstractmethod","text":"Source code in src/omnipy/data/serializer.py
@classmethod\n@abstractmethod\ndef get_output_file_suffix(cls) -> str:\n    pass\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.Serializer.is_dataset_directly_supported","title":"is_dataset_directly_supported(dataset) classmethod abstractmethod","text":"Source code in src/omnipy/data/serializer.py
@classmethod\n@abstractmethod\ndef is_dataset_directly_supported(cls, dataset: Dataset) -> bool:\n    pass\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.Serializer.serialize","title":"serialize(dataset) classmethod abstractmethod","text":"Source code in src/omnipy/data/serializer.py
@classmethod\n@abstractmethod\ndef serialize(cls, dataset: Dataset) -> Union[bytes, memoryview]:\n    pass\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.SerializerRegistry","title":"SerializerRegistry","text":"Source code in src/omnipy/data/serializer.py
class SerializerRegistry:\n    def __init__(self) -> None:\n        self._serializer_classes: list[Type[Serializer]] = []\n\n    def register(self, serializer_cls: Type[Serializer]) -> None:\n        self._serializer_classes.append(serializer_cls)\n\n    @property\n    def serializers(self) -> Tuple[Type[Serializer], ...]:\n        return tuple(self._serializer_classes)\n\n    @property\n    def tar_file_serializers(self) -> Tuple[Type[TarFileSerializer], ...]:\n        return tuple(cls for cls in self._serializer_classes if issubclass(cls, TarFileSerializer))\n\n    def auto_detect(self, dataset: Dataset):\n        return self._autodetect_serializer(dataset, self.serializers)\n\n    def auto_detect_tar_file_serializer(self, dataset: Dataset):\n        return self._autodetect_serializer(dataset, self.tar_file_serializers)\n\n    @classmethod\n    def _autodetect_serializer(cls, dataset, serializers):\n        # def _direct(dataset: Dataset, serializer: Serializer):\n        #     new_dataset_cls = serializer.get_dataset_cls_for_new()\n        #     new_dataset = new_dataset_cls(dataset)\n        #     return new_dataset\n\n        def _to_data_from_json(dataset: Dataset, serializer: Serializer):\n            new_dataset_cls = serializer.get_dataset_cls_for_new()\n            new_dataset = new_dataset_cls()\n            new_dataset.from_json(dataset.to_data())\n            return new_dataset\n\n        def _to_data_from_data(dataset: Dataset, serializer: Serializer):\n            new_dataset_cls = serializer.get_dataset_cls_for_new()\n            new_dataset = new_dataset_cls()\n            new_dataset.from_data(dataset.to_data())\n            return new_dataset\n\n        def _to_data_from_data_if_direct(dataset, serializer: Serializer):\n            assert serializer.is_dataset_directly_supported(dataset)\n            return _to_data_from_data(dataset, serializer)\n\n        # def _to_json_from_json(dataset: Dataset, serializer: Serializer):\n        #     new_dataset_cls = serializer.get_dataset_cls_for_new()\n        #     new_dataset = new_dataset_cls()\n        #     new_dataset.from_json(dataset.to_json())\n        #     return new_dataset\n\n        for func in (_to_data_from_data_if_direct, _to_data_from_json, _to_data_from_data):\n            for serializer in serializers:\n                try:\n                    new_dataset = func(dataset, serializer)\n                    return new_dataset, serializer\n                except (TypeError, ValueError, ValidationError, AssertionError) as e:\n                    pass\n\n        return None, None\n\n    def detect_tar_file_serializers_from_file_suffix(self, file_suffix: str):\n        return tuple(serializer_cls for serializer_cls in self.tar_file_serializers\n                     if serializer_cls.get_output_file_suffix() == file_suffix)\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.SerializerRegistry.serializers","title":"serializers: Tuple[Type[Serializer], ...] property","text":""},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.SerializerRegistry.tar_file_serializers","title":"tar_file_serializers: Tuple[Type[TarFileSerializer], ...] property","text":""},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.SerializerRegistry.__init__","title":"__init__()","text":"Source code in src/omnipy/data/serializer.py
def __init__(self) -> None:\n    self._serializer_classes: list[Type[Serializer]] = []\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.SerializerRegistry.auto_detect","title":"auto_detect(dataset)","text":"Source code in src/omnipy/data/serializer.py
def auto_detect(self, dataset: Dataset):\n    return self._autodetect_serializer(dataset, self.serializers)\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.SerializerRegistry.auto_detect_tar_file_serializer","title":"auto_detect_tar_file_serializer(dataset)","text":"Source code in src/omnipy/data/serializer.py
def auto_detect_tar_file_serializer(self, dataset: Dataset):\n    return self._autodetect_serializer(dataset, self.tar_file_serializers)\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.SerializerRegistry.detect_tar_file_serializers_from_file_suffix","title":"detect_tar_file_serializers_from_file_suffix(file_suffix)","text":"Source code in src/omnipy/data/serializer.py
def detect_tar_file_serializers_from_file_suffix(self, file_suffix: str):\n    return tuple(serializer_cls for serializer_cls in self.tar_file_serializers\n                 if serializer_cls.get_output_file_suffix() == file_suffix)\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.SerializerRegistry.register","title":"register(serializer_cls)","text":"Source code in src/omnipy/data/serializer.py
def register(self, serializer_cls: Type[Serializer]) -> None:\n    self._serializer_classes.append(serializer_cls)\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.TarFileSerializer","title":"TarFileSerializer","text":"

Bases: Serializer, ABC

Source code in src/omnipy/data/serializer.py
class TarFileSerializer(Serializer, ABC):\n\"\"\"\"\"\"\n    @classmethod\n    def create_tarfile_from_dataset(cls,\n                                    dataset: Dataset,\n                                    data_encode_func: Callable[[Any], Union[bytes, memoryview]]):\n        bytes_io = BytesIO()\n        with tarfile.open(fileobj=bytes_io, mode='w:gz') as tarfile_stream:\n            for obj_type, data_obj in dataset.items():\n                json_data_bytestream = BytesIO(data_encode_func(data_obj))\n                json_data_bytestream.seek(0)\n                tarinfo = TarInfo(name=f'{obj_type}.{cls.get_output_file_suffix()}')\n                tarinfo.size = len(json_data_bytestream.getbuffer())\n                tarfile_stream.addfile(tarinfo, json_data_bytestream)\n        return bytes_io.getbuffer().tobytes()\n\n    @classmethod\n    def create_dataset_from_tarfile(cls,\n                                    dataset: Dataset,\n                                    tarfile_bytes: bytes,\n                                    data_decode_func: Callable[[IO[bytes]], Any],\n                                    dictify_object_func: Callable[[str, Any], Union[Dict, str]],\n                                    import_method='from_data'):\n        with tarfile.open(fileobj=BytesIO(tarfile_bytes), mode='r:gz') as tarfile_stream:\n            for filename in tarfile_stream.getnames():\n                obj_type_file = tarfile_stream.extractfile(filename)\n                assert filename.endswith(f'.{cls.get_output_file_suffix()}')\n                obj_type = '.'.join(filename.split('.')[:-1])\n                getattr(dataset, import_method)(\n                    dictify_object_func(obj_type, data_decode_func(obj_type_file)))\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.TarFileSerializer.create_dataset_from_tarfile","title":"create_dataset_from_tarfile(dataset, tarfile_bytes, data_decode_func, dictify_object_func, import_method='from_data') classmethod","text":"Source code in src/omnipy/data/serializer.py
@classmethod\ndef create_dataset_from_tarfile(cls,\n                                dataset: Dataset,\n                                tarfile_bytes: bytes,\n                                data_decode_func: Callable[[IO[bytes]], Any],\n                                dictify_object_func: Callable[[str, Any], Union[Dict, str]],\n                                import_method='from_data'):\n    with tarfile.open(fileobj=BytesIO(tarfile_bytes), mode='r:gz') as tarfile_stream:\n        for filename in tarfile_stream.getnames():\n            obj_type_file = tarfile_stream.extractfile(filename)\n            assert filename.endswith(f'.{cls.get_output_file_suffix()}')\n            obj_type = '.'.join(filename.split('.')[:-1])\n            getattr(dataset, import_method)(\n                dictify_object_func(obj_type, data_decode_func(obj_type_file)))\n
"},{"location":"reference/omnipy/data/serializer/#omnipy.data.serializer.TarFileSerializer.create_tarfile_from_dataset","title":"create_tarfile_from_dataset(dataset, data_encode_func) classmethod","text":"Source code in src/omnipy/data/serializer.py
@classmethod\ndef create_tarfile_from_dataset(cls,\n                                dataset: Dataset,\n                                data_encode_func: Callable[[Any], Union[bytes, memoryview]]):\n    bytes_io = BytesIO()\n    with tarfile.open(fileobj=bytes_io, mode='w:gz') as tarfile_stream:\n        for obj_type, data_obj in dataset.items():\n            json_data_bytestream = BytesIO(data_encode_func(data_obj))\n            json_data_bytestream.seek(0)\n            tarinfo = TarInfo(name=f'{obj_type}.{cls.get_output_file_suffix()}')\n            tarinfo.size = len(json_data_bytestream.getbuffer())\n            tarfile_stream.addfile(tarinfo, json_data_bytestream)\n    return bytes_io.getbuffer().tobytes()\n
"},{"location":"reference/omnipy/engine/","title":"engine","text":""},{"location":"reference/omnipy/engine/base/","title":"base","text":""},{"location":"reference/omnipy/engine/base/#omnipy.engine.base.Engine","title":"Engine","text":"

Bases: ABC

Base class for engine implementations

Source code in src/omnipy/engine/base.py
class Engine(ABC):\n\"\"\"Base class for engine implementations\"\"\"\n    def __init__(self) -> None:\n        config_cls = self.get_config_cls()\n        self._config: IsEngineConfig = config_cls()\n        self._registry: Optional[IsRunStateRegistry] = None\n\n        self._init_engine()\n\n    @abstractmethod\n    def _init_engine(self) -> None:\n\"\"\"\n        Private method for initialization of an Engine subclass. Removes the need to override the\n        __init__() method in the subclass, reducing class coupling and possible error sources.\n        Must be implemented by all subclasses of Engine, but can remain empty.\n        \"\"\"\n\n    @abstractmethod\n    def _update_from_config(self) -> None:\n\"\"\"\n        Private method to signal to subclass to update any internal state that depends on config\n        values.\n        Must be implemented by all subclasses of Engine, but can remain empty.\n        \"\"\"\n\n    @classmethod\n    @abstractmethod\n    def get_config_cls(cls) -> Type[IsEngineConfig]:\n\"\"\"\n        Specification of config class mapped to an Engine subclass. Must be implemented by all\n        subclasses of Engine. If no configuration is needed, then the EngineConfig class should be\n        returned.\n        :return: Class implementing the IsEngineConfig protocol\n        \"\"\"\n\n    def set_config(self, config: IsEngineConfig) -> None:\n        self._config = config\n        self._update_from_config()\n\n    def set_registry(self, registry: Optional[IsRunStateRegistry]) -> None:\n        self._registry = registry\n
"},{"location":"reference/omnipy/engine/base/#omnipy.engine.base.Engine.__init__","title":"__init__()","text":"Source code in src/omnipy/engine/base.py
def __init__(self) -> None:\n    config_cls = self.get_config_cls()\n    self._config: IsEngineConfig = config_cls()\n    self._registry: Optional[IsRunStateRegistry] = None\n\n    self._init_engine()\n
"},{"location":"reference/omnipy/engine/base/#omnipy.engine.base.Engine.get_config_cls","title":"get_config_cls() classmethod abstractmethod","text":"

Specification of config class mapped to an Engine subclass. Must be implemented by all subclasses of Engine. If no configuration is needed, then the EngineConfig class should be returned. :return: Class implementing the IsEngineConfig protocol

Source code in src/omnipy/engine/base.py
@classmethod\n@abstractmethod\ndef get_config_cls(cls) -> Type[IsEngineConfig]:\n\"\"\"\n    Specification of config class mapped to an Engine subclass. Must be implemented by all\n    subclasses of Engine. If no configuration is needed, then the EngineConfig class should be\n    returned.\n    :return: Class implementing the IsEngineConfig protocol\n    \"\"\"\n
"},{"location":"reference/omnipy/engine/base/#omnipy.engine.base.Engine.set_config","title":"set_config(config)","text":"Source code in src/omnipy/engine/base.py
def set_config(self, config: IsEngineConfig) -> None:\n    self._config = config\n    self._update_from_config()\n
"},{"location":"reference/omnipy/engine/base/#omnipy.engine.base.Engine.set_registry","title":"set_registry(registry)","text":"Source code in src/omnipy/engine/base.py
def set_registry(self, registry: Optional[IsRunStateRegistry]) -> None:\n    self._registry = registry\n
"},{"location":"reference/omnipy/engine/job_runner/","title":"job_runner","text":""},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.DagFlowRunnerEngine","title":"DagFlowRunnerEngine","text":"

Bases: JobRunnerEngine

Base class for DAG flow runner engine implementations

Source code in src/omnipy/engine/job_runner.py
class DagFlowRunnerEngine(JobRunnerEngine):\n\"\"\"Base class for DAG flow runner engine implementations\"\"\"\n    def apply_dag_flow_decorator(self, dag_flow: IsDagFlow,\n                                 job_callback_accept_decorator: Callable) -> None:\n        def _dag_flow_decorator(call_func: Callable) -> Callable:\n            self._register_job_state(dag_flow, RunState.INITIALIZED)\n            state = self._init_dag_flow(dag_flow)\n\n            def _dag_flow_runner_call_func(*args: object, **kwargs: object) -> Any:\n                self._register_job_state(dag_flow, RunState.RUNNING)\n                flow_result = self._run_dag_flow(state, dag_flow, *args, **kwargs)\n                return self._decorate_result_with_job_finalization_detector(dag_flow, flow_result)\n\n            return _dag_flow_runner_call_func\n\n        job_callback_accept_decorator(_dag_flow_decorator)\n\n    @staticmethod\n    def default_dag_flow_run_decorator(dag_flow: IsDagFlow) -> Any:\n        def _inner_run_dag_flow(*args: object, **kwargs: object):\n            results = {}\n            result = None\n            with dag_flow.flow_context:\n                for i, job in enumerate(dag_flow.task_templates):\n                    if i == 0:\n                        results = dag_flow.get_call_args(*args, **kwargs)\n\n                    param_keys = set(inspect.signature(job).parameters.keys())\n\n                    # TODO: Refactor to remove dependency\n                    #       Also, add test for not allowing override of fixed_params\n                    if hasattr(job, 'param_key_map'):\n                        for key, val in job.param_key_map.items():\n                            if key in param_keys:\n                                param_keys.remove(key)\n                                param_keys.add(val)\n\n                    if hasattr(job, 'fixed_params'):\n                        for key in job.fixed_params.keys():\n                            if key in param_keys:\n                                param_keys.remove(key)\n\n                    params = {key: val for key, val in results.items() if key in param_keys}\n                    result = job(**params)\n\n                    if isinstance(result, dict) and len(result) > 0:\n                        results.update(result)\n                    else:\n                        results[job.name] = result\n            return result\n\n        return _inner_run_dag_flow\n\n    @abstractmethod\n    def _init_dag_flow(self, dag_flow: IsDagFlow) -> Any:\n        ...\n\n    @abstractmethod\n    def _run_dag_flow(self, state: Any, dag_flow: IsDagFlow, *args, **kwargs) -> Any:\n        ...\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.DagFlowRunnerEngine.apply_dag_flow_decorator","title":"apply_dag_flow_decorator(dag_flow, job_callback_accept_decorator)","text":"Source code in src/omnipy/engine/job_runner.py
def apply_dag_flow_decorator(self, dag_flow: IsDagFlow,\n                             job_callback_accept_decorator: Callable) -> None:\n    def _dag_flow_decorator(call_func: Callable) -> Callable:\n        self._register_job_state(dag_flow, RunState.INITIALIZED)\n        state = self._init_dag_flow(dag_flow)\n\n        def _dag_flow_runner_call_func(*args: object, **kwargs: object) -> Any:\n            self._register_job_state(dag_flow, RunState.RUNNING)\n            flow_result = self._run_dag_flow(state, dag_flow, *args, **kwargs)\n            return self._decorate_result_with_job_finalization_detector(dag_flow, flow_result)\n\n        return _dag_flow_runner_call_func\n\n    job_callback_accept_decorator(_dag_flow_decorator)\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.DagFlowRunnerEngine.default_dag_flow_run_decorator","title":"default_dag_flow_run_decorator(dag_flow) staticmethod","text":"Source code in src/omnipy/engine/job_runner.py
@staticmethod\ndef default_dag_flow_run_decorator(dag_flow: IsDagFlow) -> Any:\n    def _inner_run_dag_flow(*args: object, **kwargs: object):\n        results = {}\n        result = None\n        with dag_flow.flow_context:\n            for i, job in enumerate(dag_flow.task_templates):\n                if i == 0:\n                    results = dag_flow.get_call_args(*args, **kwargs)\n\n                param_keys = set(inspect.signature(job).parameters.keys())\n\n                # TODO: Refactor to remove dependency\n                #       Also, add test for not allowing override of fixed_params\n                if hasattr(job, 'param_key_map'):\n                    for key, val in job.param_key_map.items():\n                        if key in param_keys:\n                            param_keys.remove(key)\n                            param_keys.add(val)\n\n                if hasattr(job, 'fixed_params'):\n                    for key in job.fixed_params.keys():\n                        if key in param_keys:\n                            param_keys.remove(key)\n\n                params = {key: val for key, val in results.items() if key in param_keys}\n                result = job(**params)\n\n                if isinstance(result, dict) and len(result) > 0:\n                    results.update(result)\n                else:\n                    results[job.name] = result\n        return result\n\n    return _inner_run_dag_flow\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.FuncFlowRunnerEngine","title":"FuncFlowRunnerEngine","text":"

Bases: JobRunnerEngine

Base class for function flow runner engine implementations

Source code in src/omnipy/engine/job_runner.py
class FuncFlowRunnerEngine(JobRunnerEngine):\n\"\"\"Base class for function flow runner engine implementations\"\"\"\n    def apply_func_flow_decorator(self,\n                                  func_flow: IsFuncFlow,\n                                  job_callback_accept_decorator: Callable) -> None:\n        def _func_flow_decorator(call_func: Callable) -> Callable:\n            self._register_job_state(func_flow, RunState.INITIALIZED)\n            state = self._init_func_flow(func_flow, call_func)\n\n            def _func_flow_runner_call_func(*args: object, **kwargs: object) -> Any:\n                self._register_job_state(func_flow, RunState.RUNNING)\n                with func_flow.flow_context:\n                    flow_result = self._run_func_flow(state, func_flow, call_func, *args, **kwargs)\n                    return self._decorate_result_with_job_finalization_detector(\n                        func_flow, flow_result)\n\n            return _func_flow_runner_call_func\n\n        job_callback_accept_decorator(_func_flow_decorator)\n\n    @abstractmethod\n    def _init_func_flow(self, func_flow: IsFuncFlow, call_func: Callable) -> object:\n        ...\n\n    @abstractmethod\n    def _run_func_flow(self,\n                       state: Any,\n                       func_flow: IsFuncFlow,\n                       call_func: Callable,\n                       *args,\n                       **kwargs) -> Any:\n        ...\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.FuncFlowRunnerEngine.apply_func_flow_decorator","title":"apply_func_flow_decorator(func_flow, job_callback_accept_decorator)","text":"Source code in src/omnipy/engine/job_runner.py
def apply_func_flow_decorator(self,\n                              func_flow: IsFuncFlow,\n                              job_callback_accept_decorator: Callable) -> None:\n    def _func_flow_decorator(call_func: Callable) -> Callable:\n        self._register_job_state(func_flow, RunState.INITIALIZED)\n        state = self._init_func_flow(func_flow, call_func)\n\n        def _func_flow_runner_call_func(*args: object, **kwargs: object) -> Any:\n            self._register_job_state(func_flow, RunState.RUNNING)\n            with func_flow.flow_context:\n                flow_result = self._run_func_flow(state, func_flow, call_func, *args, **kwargs)\n                return self._decorate_result_with_job_finalization_detector(\n                    func_flow, flow_result)\n\n        return _func_flow_runner_call_func\n\n    job_callback_accept_decorator(_func_flow_decorator)\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.JobRunnerEngine","title":"JobRunnerEngine","text":"

Bases: Engine, ABC

Base class for job runner engine implementations

Source code in src/omnipy/engine/job_runner.py
class JobRunnerEngine(Engine, ABC):\n\"\"\"Base class for job runner engine implementations\"\"\"\n    def _register_job_state(self, job: IsJob, state: RunState) -> None:\n        if self._registry:\n            self._registry.set_job_state(job, state)\n\n    def _decorate_result_with_job_finalization_detector(self, job: IsJob, job_result: object):\n        if isinstance(job_result, GeneratorType):\n            job_result = cast(GeneratorType, job_result)\n\n            def detect_finished_generator_decorator():\n                try:\n                    value = yield next(job_result)\n                    while True:\n                        value = yield job_result.send(value)\n                except StopIteration:\n                    self._register_job_state(job, RunState.FINISHED)\n\n            return detect_finished_generator_decorator()\n        elif isinstance(job_result, AsyncGeneratorType):\n            job_result = cast(AsyncGeneratorType, job_result)\n\n            async def detect_finished_async_generator_decorator():\n                try:\n                    if sys.version_info >= (3, 10):\n                        value = yield await anext(job_result)\n                    else:\n                        value = yield await job_result.__anext__()\n                    while True:\n                        value = yield await job_result.asend(value)\n                except StopAsyncIteration:\n                    self._register_job_state(job, RunState.FINISHED)\n\n            return detect_finished_async_generator_decorator()\n\n        elif inspect.isawaitable(job_result):\n            job_result = cast(Awaitable, job_result)\n\n            async def detect_finished_coroutine():\n                result = await job_result\n                self._register_job_state(job, RunState.FINISHED)\n                return result\n\n            return detect_finished_coroutine()\n        else:\n            self._register_job_state(job, RunState.FINISHED)\n            return job_result\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.LinearFlowRunnerEngine","title":"LinearFlowRunnerEngine","text":"

Bases: JobRunnerEngine

Base class for linear flow runner engine implementations

Source code in src/omnipy/engine/job_runner.py
class LinearFlowRunnerEngine(JobRunnerEngine):\n\"\"\"Base class for linear flow runner engine implementations\"\"\"\n    def apply_linear_flow_decorator(self,\n                                    linear_flow: IsLinearFlow,\n                                    job_callback_accept_decorator: Callable) -> None:\n        def _linear_flow_decorator(call_func: Callable) -> Callable:\n            self._register_job_state(linear_flow, RunState.INITIALIZED)\n            state = self._init_linear_flow(linear_flow)\n\n            def _linear_flow_runner_call_func(*args: object, **kwargs: object) -> Any:\n                self._register_job_state(linear_flow, RunState.RUNNING)\n                flow_result = self._run_linear_flow(state, linear_flow, *args, **kwargs)\n                return self._decorate_result_with_job_finalization_detector(\n                    linear_flow, flow_result)\n\n            return _linear_flow_runner_call_func\n\n        job_callback_accept_decorator(_linear_flow_decorator)\n\n    @staticmethod\n    def default_linear_flow_run_decorator(linear_flow: IsLinearFlow) -> Any:\n        def _inner_run_linear_flow(*args: object, **kwargs: object):\n\n            result = None\n            with linear_flow.flow_context:\n                for i, job in enumerate(linear_flow.task_templates):\n                    # TODO: Better handling of kwargs\n                    if i == 0:\n                        result = job(*args, **kwargs)\n                    else:\n                        result = job(*args)\n\n                    args = (result,)\n            return result\n\n        return _inner_run_linear_flow\n\n    @abstractmethod\n    def _init_linear_flow(self, linear_flow: IsLinearFlow) -> Any:\n        ...\n\n    @abstractmethod\n    def _run_linear_flow(self, state: Any, linear_flow: IsLinearFlow, *args, **kwargs) -> Any:\n        ...\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.LinearFlowRunnerEngine.apply_linear_flow_decorator","title":"apply_linear_flow_decorator(linear_flow, job_callback_accept_decorator)","text":"Source code in src/omnipy/engine/job_runner.py
def apply_linear_flow_decorator(self,\n                                linear_flow: IsLinearFlow,\n                                job_callback_accept_decorator: Callable) -> None:\n    def _linear_flow_decorator(call_func: Callable) -> Callable:\n        self._register_job_state(linear_flow, RunState.INITIALIZED)\n        state = self._init_linear_flow(linear_flow)\n\n        def _linear_flow_runner_call_func(*args: object, **kwargs: object) -> Any:\n            self._register_job_state(linear_flow, RunState.RUNNING)\n            flow_result = self._run_linear_flow(state, linear_flow, *args, **kwargs)\n            return self._decorate_result_with_job_finalization_detector(\n                linear_flow, flow_result)\n\n        return _linear_flow_runner_call_func\n\n    job_callback_accept_decorator(_linear_flow_decorator)\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.LinearFlowRunnerEngine.default_linear_flow_run_decorator","title":"default_linear_flow_run_decorator(linear_flow) staticmethod","text":"Source code in src/omnipy/engine/job_runner.py
@staticmethod\ndef default_linear_flow_run_decorator(linear_flow: IsLinearFlow) -> Any:\n    def _inner_run_linear_flow(*args: object, **kwargs: object):\n\n        result = None\n        with linear_flow.flow_context:\n            for i, job in enumerate(linear_flow.task_templates):\n                # TODO: Better handling of kwargs\n                if i == 0:\n                    result = job(*args, **kwargs)\n                else:\n                    result = job(*args)\n\n                args = (result,)\n        return result\n\n    return _inner_run_linear_flow\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.TaskRunnerEngine","title":"TaskRunnerEngine","text":"

Bases: JobRunnerEngine

Base class for task runner engine implementations

Source code in src/omnipy/engine/job_runner.py
class TaskRunnerEngine(JobRunnerEngine):\n\"\"\"Base class for task runner engine implementations\"\"\"\n    def apply_task_decorator(self, task: IsTask, job_callback_accept_decorator: Callable) -> None:\n        def _task_decorator(call_func: Callable) -> Callable:\n            self._register_job_state(task, RunState.INITIALIZED)\n            state = self._init_task(task, call_func)\n\n            def _task_runner_call_func(*args: Any, **kwargs: Any) -> Any:\n                self._register_job_state(task, RunState.RUNNING)\n                task_result = self._run_task(state, task, call_func, *args, **kwargs)\n                return self._decorate_result_with_job_finalization_detector(task, task_result)\n\n            return _task_runner_call_func\n\n        job_callback_accept_decorator(_task_decorator)\n\n    @abstractmethod\n    def _init_task(self, task: IsTask, call_func: Callable) -> Any:\n        ...\n\n    @abstractmethod\n    def _run_task(self, state: Any, task: IsTask, call_func: Callable, *args, **kwargs) -> Any:\n        ...\n
"},{"location":"reference/omnipy/engine/job_runner/#omnipy.engine.job_runner.TaskRunnerEngine.apply_task_decorator","title":"apply_task_decorator(task, job_callback_accept_decorator)","text":"Source code in src/omnipy/engine/job_runner.py
def apply_task_decorator(self, task: IsTask, job_callback_accept_decorator: Callable) -> None:\n    def _task_decorator(call_func: Callable) -> Callable:\n        self._register_job_state(task, RunState.INITIALIZED)\n        state = self._init_task(task, call_func)\n\n        def _task_runner_call_func(*args: Any, **kwargs: Any) -> Any:\n            self._register_job_state(task, RunState.RUNNING)\n            task_result = self._run_task(state, task, call_func, *args, **kwargs)\n            return self._decorate_result_with_job_finalization_detector(task, task_result)\n\n        return _task_runner_call_func\n\n    job_callback_accept_decorator(_task_decorator)\n
"},{"location":"reference/omnipy/engine/local/","title":"local","text":""},{"location":"reference/omnipy/engine/local/#omnipy.engine.local.LocalRunner","title":"LocalRunner","text":"

Bases: TaskRunnerEngine, LinearFlowRunnerEngine, DagFlowRunnerEngine, FuncFlowRunnerEngine

Local job runner

Source code in src/omnipy/engine/local.py
class LocalRunner(TaskRunnerEngine,\n                  LinearFlowRunnerEngine,\n                  DagFlowRunnerEngine,\n                  FuncFlowRunnerEngine):\n\"\"\"Local job runner\"\"\"\n    def _init_engine(self) -> None:\n        ...\n\n    def _update_from_config(self) -> None:\n        ...\n\n    @classmethod\n    def get_config_cls(cls) -> Type[IsLocalRunnerConfig]:\n        return LocalRunnerConfig\n\n    def _init_task(self, task: IsTask, call_func: Callable) -> Any:\n        ...\n\n    def _run_task(self, state: Any, task: IsTask, call_func: Callable, *args, **kwargs) -> Any:\n        return call_func(*args, **kwargs)\n\n    def _init_linear_flow(self, flow: IsLinearFlow) -> Any:\n        ...\n\n    def _run_linear_flow(self, state: Any, flow: IsLinearFlow, *args, **kwargs) -> Any:\n        return self.default_linear_flow_run_decorator(flow)(*args, **kwargs)\n\n    def _init_dag_flow(self, flow: IsDagFlow) -> Any:\n        ...\n\n    def _run_dag_flow(self, state: Any, flow: IsDagFlow, *args, **kwargs) -> Any:\n        return self.default_dag_flow_run_decorator(flow)(*args, **kwargs)\n\n    def _init_func_flow(self, func_flow: IsFuncFlow, call_func: Callable) -> object:\n        pass\n\n    def _run_func_flow(self,\n                       state: Any,\n                       func_flow: IsFuncFlow,\n                       call_func: Callable,\n                       *args,\n                       **kwargs) -> Any:\n        with func_flow.flow_context:\n            return call_func(*args, **kwargs)\n
"},{"location":"reference/omnipy/engine/local/#omnipy.engine.local.LocalRunner.get_config_cls","title":"get_config_cls() classmethod","text":"Source code in src/omnipy/engine/local.py
@classmethod\ndef get_config_cls(cls) -> Type[IsLocalRunnerConfig]:\n    return LocalRunnerConfig\n
"},{"location":"reference/omnipy/hub/","title":"hub","text":""},{"location":"reference/omnipy/hub/entry/","title":"entry","text":""},{"location":"reference/omnipy/hub/entry/#omnipy.hub.entry.RuntimeEntryPublisher","title":"RuntimeEntryPublisher dataclass","text":"

Bases: DataPublisher

Source code in src/omnipy/hub/entry.py
@dataclass\nclass RuntimeEntryPublisher(DataPublisher):\n    _back: Optional[IsRuntime] = field(default=None, init=False, repr=False)\n\n    def __setattr__(self, key, value):\n        super().__setattr__(key, value)\n\n        if hasattr(self, key) and not key.startswith('_') and self._back is not None:\n            self._back.reset_subscriptions()\n
"},{"location":"reference/omnipy/hub/entry/#omnipy.hub.entry.RuntimeEntryPublisher.__setattr__","title":"__setattr__(key, value)","text":"Source code in src/omnipy/hub/entry.py
def __setattr__(self, key, value):\n    super().__setattr__(key, value)\n\n    if hasattr(self, key) and not key.startswith('_') and self._back is not None:\n        self._back.reset_subscriptions()\n
"},{"location":"reference/omnipy/hub/root_log/","title":"root_log","text":""},{"location":"reference/omnipy/hub/root_log/#omnipy.hub.root_log.RootLogConfigEntryPublisher","title":"RootLogConfigEntryPublisher dataclass","text":"

Bases: RootLogConfig, RuntimeEntryPublisher

Source code in src/omnipy/hub/root_log.py
@dataclass\nclass RootLogConfigEntryPublisher(RootLogConfig, RuntimeEntryPublisher):\n    ...\n
"},{"location":"reference/omnipy/hub/root_log/#omnipy.hub.root_log.RootLogObjects","title":"RootLogObjects dataclass","text":"Source code in src/omnipy/hub/root_log.py
@dataclass\nclass RootLogObjects:\n    _config: IsRootLogConfig = field(\n        init=False, repr=False, default_factory=RootLogConfigEntryPublisher)\n\n    formatter: Optional[logging.Formatter] = None\n    stdout_handler: Optional[StreamHandler] = None\n    stderr_handler: Optional[StreamHandler] = None\n    file_handler: Optional[TimedRotatingFileHandler] = None\n\n    def __post_init__(self):\n        self._configure_all_objects()\n\n    def set_config(self, config: IsRootLogConfig):\n        self._config = config\n        self._configure_all_objects()\n\n    def _configure_all_objects(self):\n        self._remove_all_handlers_from_root_logger()\n\n        self._configure_formatter()\n        self._configure_stdout_handler()\n        self._configure_stderr_handler()\n        self._configure_file_handler()\n\n        self._add_all_handlers_to_root_logger()\n\n    def _configure_formatter(self):\n        if self._config.log_format_str:\n            datetime_fmt = get_datetime_format(self._config.locale)\n            self.formatter = logging.Formatter(self._config.log_format_str, datetime_fmt, style='{')\n        else:\n            self.formatter = None\n\n    def _configure_stdout_handler(self):\n        if self._config.log_to_stdout:\n            config = self._config\n\n            class StdErrBasedMaxLevelFilter(logging.Filter):\n                def filter(self, record):\n                    return record.levelno < config.stderr_log_min_level\n\n            self.stdout_handler = StreamHandler(stdout)\n            self.stdout_handler.setLevel(self._config.stdout_log_min_level)\n            if self._config.log_to_stderr:\n                self.stdout_handler.addFilter(StdErrBasedMaxLevelFilter())\n        else:\n            self.stdout_handler = None\n\n    def _configure_stderr_handler(self) -> Optional[StreamHandler]:\n        if self._config.log_to_stderr:\n            self.stderr_handler = StreamHandler(stderr)\n            self.stderr_handler.setLevel(self._config.stderr_log_min_level)\n        else:\n            self.stderr_handler = None\n\n    def _configure_file_handler(self) -> Optional[TimedRotatingFileHandler]:\n        if self._config.log_to_file:\n            log_dir_path = self._config.file_log_dir_path\n            if not os.path.exists(log_dir_path):\n                os.makedirs(log_dir_path)\n\n            log_file_path = Path(log_dir_path).joinpath('omnipy.log')\n            self.file_handler = TimedRotatingFileHandler(\n                log_file_path, when='d', interval=1, backupCount=7)\n            self.file_handler.setLevel(self._config.file_log_min_level)\n        else:\n            self.file_handler = None\n\n    def _remove_all_handlers_from_root_logger(self):\n        root_logger = logging.root\n        handlersToRemove = [\n            handler for handler in root_logger.handlers\n            if isinstance(handler, StreamHandler) or isinstance(handler, TimedRotatingFileHandler)\n        ]\n        for handler in handlersToRemove:\n            root_logger.removeHandler(handler)\n\n    def _add_handler_to_root_logger(self, handler: Optional[logging.Handler]):\n        if handler:\n            root_logger = logging.root\n            if self.formatter:\n                handler.setFormatter(self.formatter)\n            root_logger.addHandler(handler)\n\n    def _add_all_handlers_to_root_logger(self):\n        self._add_handler_to_root_logger(self.stdout_handler)\n        self._add_handler_to_root_logger(self.stderr_handler)\n        self._add_handler_to_root_logger(self.file_handler)\n
"},{"location":"reference/omnipy/hub/root_log/#omnipy.hub.root_log.RootLogObjects.file_handler","title":"file_handler: Optional[TimedRotatingFileHandler] = None instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/root_log/#omnipy.hub.root_log.RootLogObjects.formatter","title":"formatter: Optional[logging.Formatter] = None instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/root_log/#omnipy.hub.root_log.RootLogObjects.stderr_handler","title":"stderr_handler: Optional[StreamHandler] = None instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/root_log/#omnipy.hub.root_log.RootLogObjects.stdout_handler","title":"stdout_handler: Optional[StreamHandler] = None instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/root_log/#omnipy.hub.root_log.RootLogObjects.__post_init__","title":"__post_init__()","text":"Source code in src/omnipy/hub/root_log.py
def __post_init__(self):\n    self._configure_all_objects()\n
"},{"location":"reference/omnipy/hub/root_log/#omnipy.hub.root_log.RootLogObjects.set_config","title":"set_config(config)","text":"Source code in src/omnipy/hub/root_log.py
def set_config(self, config: IsRootLogConfig):\n    self._config = config\n    self._configure_all_objects()\n
"},{"location":"reference/omnipy/hub/runtime/","title":"runtime","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.Runtime","title":"Runtime dataclass","text":"

Bases: DataPublisher

Source code in src/omnipy/hub/runtime.py
@dataclass\nclass Runtime(DataPublisher):\n    config: IsRuntimeConfig = field(default_factory=RuntimeConfig)\n    objects: IsRuntimeObjects = field(default_factory=RuntimeObjects)\n\n    def __post_init__(self):\n        super().__init__()\n\n        self.config._back = self\n        self.config.root_log._back = self\n        self.objects._back = self\n\n        self.reset_subscriptions()\n\n    def reset_subscriptions(self):\n        self.config.unsubscribe_all()\n        self.objects.unsubscribe_all()\n\n        self.config.subscribe('job', self.objects.job_creator.set_config)\n        self.config.subscribe('local', self.objects.local.set_config)\n        self.config.subscribe('prefect', self.objects.prefect.set_config)\n        self.config.subscribe('root_log', self.objects.root_log.set_config)\n\n        self.config.subscribe('local', self._update_job_creator_engine)\n        self.config.subscribe('prefect', self._update_job_creator_engine)\n        self.config.subscribe('engine', self._update_job_creator_engine)\n\n        self.objects.subscribe('registry', self.objects.local.set_registry)\n        self.objects.subscribe('registry', self.objects.prefect.set_registry)\n\n        self.objects.subscribe('local', self._update_local_runner_config)\n        self.objects.subscribe('prefect', self._update_prefect_engine_config)\n\n    def _get_engine_config(self, engine_choice: EngineChoice):\n        return getattr(self.config, engine_choice)\n\n    def _set_engine_config(self, engine_choice: EngineChoice, engine_config: IsEngineConfig):\n        return setattr(self.config, engine_choice, engine_config)\n\n    def _get_engine(self, engine_choice: EngineChoice):\n        return getattr(self.objects, engine_choice)\n\n    def _new_engine_config_if_new_cls(self, engine: IsEngine, engine_choice: EngineChoice) -> None:\n        # TODO: when parsing config from file is implemented, make sure that the new engine\n        #       config classes here reparse the config files\n        engine_config_cls = engine.get_config_cls()\n        if self._get_engine_config(engine_choice).__class__ is not engine_config_cls:\n            self._set_engine_config(engine_choice, engine_config_cls())\n\n    def _update_local_runner_config(self, local_runner: IsEngine):\n        self._new_engine_config_if_new_cls(local_runner, EngineChoice.LOCAL)\n\n    def _update_prefect_engine_config(self, prefect_engine: IsEngine):\n        self._new_engine_config_if_new_cls(prefect_engine, EngineChoice.PREFECT)\n\n    def _update_job_creator_engine(self, _item_changed: Any):\n        self.objects.job_creator.set_engine(self._get_engine(self.config.engine))\n\n    def _create_serializer_registry(self):\n        registry = SerializerRegistry()\n\n        registry.register(PandasDatasetToTarFileSerializer)\n        registry.register(RawDatasetToTarFileSerializer)\n        registry.register(JsonDatasetToTarFileSerializer)\n\n        return registry\n
"},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.Runtime.config","title":"config: IsRuntimeConfig = field(default_factory=RuntimeConfig) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.Runtime.objects","title":"objects: IsRuntimeObjects = field(default_factory=RuntimeObjects) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.Runtime.__post_init__","title":"__post_init__()","text":"Source code in src/omnipy/hub/runtime.py
def __post_init__(self):\n    super().__init__()\n\n    self.config._back = self\n    self.config.root_log._back = self\n    self.objects._back = self\n\n    self.reset_subscriptions()\n
"},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.Runtime.reset_subscriptions","title":"reset_subscriptions()","text":"Source code in src/omnipy/hub/runtime.py
def reset_subscriptions(self):\n    self.config.unsubscribe_all()\n    self.objects.unsubscribe_all()\n\n    self.config.subscribe('job', self.objects.job_creator.set_config)\n    self.config.subscribe('local', self.objects.local.set_config)\n    self.config.subscribe('prefect', self.objects.prefect.set_config)\n    self.config.subscribe('root_log', self.objects.root_log.set_config)\n\n    self.config.subscribe('local', self._update_job_creator_engine)\n    self.config.subscribe('prefect', self._update_job_creator_engine)\n    self.config.subscribe('engine', self._update_job_creator_engine)\n\n    self.objects.subscribe('registry', self.objects.local.set_registry)\n    self.objects.subscribe('registry', self.objects.prefect.set_registry)\n\n    self.objects.subscribe('local', self._update_local_runner_config)\n    self.objects.subscribe('prefect', self._update_prefect_engine_config)\n
"},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeConfig","title":"RuntimeConfig dataclass","text":"

Bases: RuntimeEntryPublisher

Source code in src/omnipy/hub/runtime.py
@dataclass\nclass RuntimeConfig(RuntimeEntryPublisher):\n    job: IsJobConfig = field(default_factory=JobConfig)\n    engine: EngineChoice = EngineChoice.LOCAL\n    local: IsLocalRunnerConfig = field(default_factory=LocalRunnerConfig)\n    prefect: IsPrefectEngineConfig = field(default_factory=PrefectEngineConfig)\n    root_log: IsRootLogConfig = field(default_factory=RootLogConfigEntryPublisher)\n
"},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeConfig.engine","title":"engine: EngineChoice = EngineChoice.LOCAL instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeConfig.job","title":"job: IsJobConfig = field(default_factory=JobConfig) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeConfig.local","title":"local: IsLocalRunnerConfig = field(default_factory=LocalRunnerConfig) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeConfig.prefect","title":"prefect: IsPrefectEngineConfig = field(default_factory=PrefectEngineConfig) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeConfig.root_log","title":"root_log: IsRootLogConfig = field(default_factory=RootLogConfigEntryPublisher) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeObjects","title":"RuntimeObjects dataclass","text":"

Bases: RuntimeEntryPublisher

Source code in src/omnipy/hub/runtime.py
@dataclass\nclass RuntimeObjects(RuntimeEntryPublisher):\n    job_creator: IsJobConfigHolder = field(default_factory=_job_creator_factory)\n    local: IsEngine = field(default_factory=LocalRunner)\n    prefect: IsEngine = field(default_factory=PrefectEngine)\n    registry: IsRunStateRegistry = field(default_factory=RunStateRegistry)\n    root_log: IsRootLogObjects = field(default_factory=RootLogObjects)\n
"},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeObjects.job_creator","title":"job_creator: IsJobConfigHolder = field(default_factory=_job_creator_factory) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeObjects.local","title":"local: IsEngine = field(default_factory=LocalRunner) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeObjects.prefect","title":"prefect: IsEngine = field(default_factory=PrefectEngine) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeObjects.registry","title":"registry: IsRunStateRegistry = field(default_factory=RunStateRegistry) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/hub/runtime/#omnipy.hub.runtime.RuntimeObjects.root_log","title":"root_log: IsRootLogObjects = field(default_factory=RootLogObjects) instance-attribute class-attribute","text":""},{"location":"reference/omnipy/log/","title":"log","text":""},{"location":"reference/omnipy/log/constants/","title":"constants","text":""},{"location":"reference/omnipy/log/constants/#omnipy.log.constants.OMNIPY_LOG_FORMAT_STR","title":"OMNIPY_LOG_FORMAT_STR: str = '%(levelname)s - %(message)s (%(name)s)' module-attribute","text":""},{"location":"reference/omnipy/log/mixin/","title":"mixin","text":""},{"location":"reference/omnipy/log/mixin/#omnipy.log.mixin.LogMixin","title":"LogMixin","text":"Source code in src/omnipy/log/mixin.py
class LogMixin:\n    def __init__(self) -> None:\n        self._logger: Logger = getLogger(f'{self.__class__.__module__}.{self.__class__.__name__}')\n        self._logger.setLevel(INFO)\n\n    @property\n    def logger(self) -> Logger:\n        return self._logger\n\n    def log(self, log_msg: str, level: int = INFO, datetime_obj: Optional[datetime] = None):\n        if self._logger is not None:\n            create_time = time.mktime(datetime_obj.timetuple()) if datetime_obj else time.time()\n            _former_log_record_factory = logging.getLogRecordFactory()\n            if _former_log_record_factory.__name__ != '_log_record_editor':\n\n                def _log_record_editor(*args, **kwargs):\n                    record = _former_log_record_factory(*args, **kwargs)\n                    record.created = create_time\n                    record.engine = f\"[{record.name.split('.')[0].upper()}]\"\n                    if len(record.engine) < 9:\n                        record.engine += ' '\n                    return record\n\n                logging.setLogRecordFactory(_log_record_editor)\n\n            self._logger.log(level, log_msg)\n
"},{"location":"reference/omnipy/log/mixin/#omnipy.log.mixin.LogMixin.logger","title":"logger: Logger property","text":""},{"location":"reference/omnipy/log/mixin/#omnipy.log.mixin.LogMixin.__init__","title":"__init__()","text":"Source code in src/omnipy/log/mixin.py
def __init__(self) -> None:\n    self._logger: Logger = getLogger(f'{self.__class__.__module__}.{self.__class__.__name__}')\n    self._logger.setLevel(INFO)\n
"},{"location":"reference/omnipy/log/mixin/#omnipy.log.mixin.LogMixin.log","title":"log(log_msg, level=INFO, datetime_obj=None)","text":"Source code in src/omnipy/log/mixin.py
def log(self, log_msg: str, level: int = INFO, datetime_obj: Optional[datetime] = None):\n    if self._logger is not None:\n        create_time = time.mktime(datetime_obj.timetuple()) if datetime_obj else time.time()\n        _former_log_record_factory = logging.getLogRecordFactory()\n        if _former_log_record_factory.__name__ != '_log_record_editor':\n\n            def _log_record_editor(*args, **kwargs):\n                record = _former_log_record_factory(*args, **kwargs)\n                record.created = create_time\n                record.engine = f\"[{record.name.split('.')[0].upper()}]\"\n                if len(record.engine) < 9:\n                    record.engine += ' '\n                return record\n\n            logging.setLogRecordFactory(_log_record_editor)\n\n        self._logger.log(level, log_msg)\n
"},{"location":"reference/omnipy/log/registry/","title":"registry","text":""},{"location":"reference/omnipy/log/registry/#omnipy.log.registry.RunStateRegistry","title":"RunStateRegistry","text":"

Bases: LogMixin

Source code in src/omnipy/log/registry.py
class RunStateRegistry(LogMixin):\n    def __init__(self) -> None:\n\n        self._jobs: Dict[str, IsUniquelyNamedJob] = {}\n        self._job_states: Dict[str, RunState] = {}\n        self._state_jobs: DefaultDict[RunState, List[str]] = defaultdict(list)\n        self._job_state_datetime: Dict[Tuple[str, RunState], datetime] = {}\n\n        super().__init__()\n\n    def get_job_state(self, job: IsUniquelyNamedJob) -> RunState:\n        return self._job_states[job.unique_name]\n\n    def get_job_state_datetime(self, job: IsUniquelyNamedJob, state: RunState) -> datetime:\n        return self._job_state_datetime[(job.unique_name, state)]\n\n    def all_jobs(self, state: Optional[RunState] = None) -> Tuple[IsUniquelyNamedJob, ...]:\n        if state is not None:\n            job_unique_names = self._state_jobs[state]\n            return tuple(self._jobs[unique_name] for unique_name in job_unique_names)\n        else:\n            return tuple(self._jobs.values())\n\n    def set_job_state(self, job: IsUniquelyNamedJob, state: RunState) -> None:\n        cur_datetime = datetime.now()\n\n        if job.unique_name in self._jobs:\n            self._update_job_registration(job, state)\n        else:\n            self._register_new_job(job, state)\n\n        self._update_job_stats(job, state, cur_datetime)\n        self._log_state_change(job, state)\n\n    def _other_job_registered_with_same_unique_name(self, job: IsUniquelyNamedJob) -> bool:\n        other_job_same_unique_name = self._jobs.get(job.unique_name)\n        return bool(other_job_same_unique_name) and id(other_job_same_unique_name) != id(job)\n\n    def _update_job_registration(self, job: IsUniquelyNamedJob, state: RunState) -> None:\n        # TODO: Reimplement logic using a state machine, e.g. \"transitions\" package\n        if self._other_job_registered_with_same_unique_name(job):\n            while self._other_job_registered_with_same_unique_name(job):\n                job.regenerate_unique_name()\n            self._register_new_job(job, state)\n        else:\n            prev_state = self._job_states[job.unique_name]\n            if state == prev_state + 1:\n                self._state_jobs[prev_state].remove(job.unique_name)\n            else:\n                self._raise_job_error(\n                    job,\n                    f'Transitioning from state {prev_state.name} '\n                    f'to state {state.name} is not allowed',\n                )\n\n    def _register_new_job(self, job, state) -> None:\n        if state != RunState.INITIALIZED:\n            self._raise_job_error(\n                job,\n                f'Initial state of must be \"INITIALIZED\", not \"{state.name}\"',\n            )\n        self._jobs[job.unique_name] = job\n\n    def _update_job_stats(self, job, state, cur_datetime) -> None:\n        self._job_states[job.unique_name] = state\n        self._state_jobs[state].append(job.unique_name)\n        self._job_state_datetime[(job.unique_name, state)] = cur_datetime\n\n    def _log_state_change(self, job: IsUniquelyNamedJob, state: RunState) -> None:\n        log_msg = RunStateLogMessages[state.name].value.format(job.unique_name)\n        datetime_obj = self.get_job_state_datetime(job, state)\n        self.log(log_msg, datetime_obj=datetime_obj)\n\n    def _raise_job_error(self, job: IsUniquelyNamedJob, msg: str) -> None:\n        raise ValueError(f'Error in job \"{job.unique_name}\": {msg}')\n
"},{"location":"reference/omnipy/log/registry/#omnipy.log.registry.RunStateRegistry.__init__","title":"__init__()","text":"Source code in src/omnipy/log/registry.py
def __init__(self) -> None:\n\n    self._jobs: Dict[str, IsUniquelyNamedJob] = {}\n    self._job_states: Dict[str, RunState] = {}\n    self._state_jobs: DefaultDict[RunState, List[str]] = defaultdict(list)\n    self._job_state_datetime: Dict[Tuple[str, RunState], datetime] = {}\n\n    super().__init__()\n
"},{"location":"reference/omnipy/log/registry/#omnipy.log.registry.RunStateRegistry.all_jobs","title":"all_jobs(state=None)","text":"Source code in src/omnipy/log/registry.py
def all_jobs(self, state: Optional[RunState] = None) -> Tuple[IsUniquelyNamedJob, ...]:\n    if state is not None:\n        job_unique_names = self._state_jobs[state]\n        return tuple(self._jobs[unique_name] for unique_name in job_unique_names)\n    else:\n        return tuple(self._jobs.values())\n
"},{"location":"reference/omnipy/log/registry/#omnipy.log.registry.RunStateRegistry.get_job_state","title":"get_job_state(job)","text":"Source code in src/omnipy/log/registry.py
def get_job_state(self, job: IsUniquelyNamedJob) -> RunState:\n    return self._job_states[job.unique_name]\n
"},{"location":"reference/omnipy/log/registry/#omnipy.log.registry.RunStateRegistry.get_job_state_datetime","title":"get_job_state_datetime(job, state)","text":"Source code in src/omnipy/log/registry.py
def get_job_state_datetime(self, job: IsUniquelyNamedJob, state: RunState) -> datetime:\n    return self._job_state_datetime[(job.unique_name, state)]\n
"},{"location":"reference/omnipy/log/registry/#omnipy.log.registry.RunStateRegistry.set_job_state","title":"set_job_state(job, state)","text":"Source code in src/omnipy/log/registry.py
def set_job_state(self, job: IsUniquelyNamedJob, state: RunState) -> None:\n    cur_datetime = datetime.now()\n\n    if job.unique_name in self._jobs:\n        self._update_job_registration(job, state)\n    else:\n        self._register_new_job(job, state)\n\n    self._update_job_stats(job, state, cur_datetime)\n    self._log_state_change(job, state)\n
"},{"location":"reference/omnipy/modules/","title":"modules","text":""},{"location":"reference/omnipy/modules/fairtracks/","title":"fairtracks","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/","title":"create_filter","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.annotations","title":"annotations = response.json()['data']['hits'] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.annotations_endpt","title":"annotations_endpt = 'https://api.gdc.cancer.gov/annotations' module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.ant_id_list","title":"ant_id_list = [] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.buckets","title":"buckets = response.json()['data']['aggregations']['program.name']['buckets'] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.case_id_list","title":"case_id_list = [] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.cases","title":"cases = response.json()['data']['hits'] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.cases_endpt","title":"cases_endpt = 'https://api.gdc.cancer.gov/cases' module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.download_all_cases","title":"download_all_cases = False module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.download_all_projects","title":"download_all_projects = False module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.fields","title":"fields = ['annotation_id'] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.file_id_list","title":"file_id_list = [] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.filters","title":"filters = {'op': 'in', 'content': {'field': entry[0:-1] + '_id', 'value': id_dict[entry]}} module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.id_dict","title":"id_dict = {'projects': proj_id_list, 'cases': case_id_list, 'files': file_id_list, 'annotations': ant_id_list} module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.number_of_cases","title":"number_of_cases = 2 module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.number_of_files","title":"number_of_files = 2 module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.number_of_projects","title":"number_of_projects = 2 module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.params","title":"params = {'fields': fields, 'filters': json.dumps(filters)} module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.proj_id_list","title":"proj_id_list = [] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.projects_endpt","title":"projects_endpt = 'https://api.gdc.cancer.gov/projects' module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.projects_list","title":"projects_list = response.json()['data']['hits'] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.response","title":"response = requests.get(annotations_endpt, params=params) module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.size","title":"size = size_max module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/create_filter/#omnipy.modules.fairtracks.create_filter.size_max","title":"size_max = buckets[j]['doc_count'] module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/functions/","title":"functions","text":""},{"location":"reference/omnipy/modules/fairtracks/functions/#omnipy.modules.fairtracks.functions.ENCODE_BASE_URL","title":"ENCODE_BASE_URL = 'https://www.encodeproject.org/' module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/functions/#omnipy.modules.fairtracks.functions.ENCODE_HEADERS","title":"ENCODE_HEADERS = {'accept': 'application/json'} module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/functions/#omnipy.modules.fairtracks.functions.GDC_BASE_URL","title":"GDC_BASE_URL = 'https://api.gdc.cancer.gov/' module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/functions/#omnipy.modules.fairtracks.functions.encode_api","title":"encode_api(endpoint='experiments', id=None, limit=None, format='json', frame='object')","text":"Source code in src/omnipy/modules/fairtracks/functions.py
def encode_api(endpoint='experiments', id=None, limit=None, format='json', frame='object'):\n    api_url = ENCODE_BASE_URL + endpoint + '/' + (id if id else '@@listing') + '?' + '&'.join(\n        (['limit=' + limit] if limit else []) + (['format=' + format] if format else [])\n        + (['frame=' + frame] if frame else []))\n    print(api_url)\n    response = requests.get(api_url, headers=ENCODE_HEADERS)\n    if response.status_code == 200:\n        results = response.json()\n        if results['notification'] == 'Success':\n            graph = results['@graph']\n            return graph\n    else:\n        print('No result found')\n
"},{"location":"reference/omnipy/modules/fairtracks/functions/#omnipy.modules.fairtracks.functions.gdc_api","title":"gdc_api(object_type='projects', starting_point=None, size=None)","text":"Source code in src/omnipy/modules/fairtracks/functions.py
def gdc_api(object_type='projects', starting_point=None, size=None):\n    api_url = GDC_BASE_URL + object_type + '/' + '?' + \\\n              '&'.join(\n                  (['from=' + starting_point] if starting_point else [])\n                  + (['size=' + size] if size else [])\n                  + (['expand=' + 'project'] if object_type == 'cases' else [])\n              )\n    print(api_url)\n    response = requests.get(api_url)\n    if response.status_code != 200:\n        print('No result found')\n        return None\n\n    results = response.json()\n\n    if len(results['warnings']) > 0:\n        print('The following warnings have been encountered:')\n        print(results['warnings'])\n        return None\n\n    hits = (results['data']['hits'])\n    return hits\n
"},{"location":"reference/omnipy/modules/fairtracks/get_from_filter/","title":"get_from_filter","text":""},{"location":"reference/omnipy/modules/fairtracks/get_from_filter/#omnipy.modules.fairtracks.get_from_filter.endpt","title":"endpt = 'https://api.gdc.cancer.gov/' + endpt_str module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/get_from_filter/#omnipy.modules.fairtracks.get_from_filter.endpt_map","title":"endpt_map = endpt + '/_mapping' module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/get_from_filter/#omnipy.modules.fairtracks.get_from_filter.fields","title":"fields = ','.join(fields) module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/get_from_filter/#omnipy.modules.fairtracks.get_from_filter.filters","title":"filters = json.load(infile) module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/get_from_filter/#omnipy.modules.fairtracks.get_from_filter.params","title":"params = {'filters': json.dumps(filters)} module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/get_from_filter/#omnipy.modules.fairtracks.get_from_filter.response","title":"response = requests.get(endpt, params=params) module-attribute","text":""},{"location":"reference/omnipy/modules/fairtracks/tasks/","title":"tasks","text":""},{"location":"reference/omnipy/modules/fairtracks/tasks/#omnipy.modules.fairtracks.tasks.import_dataset_from_encode","title":"import_dataset_from_encode(endpoints, max_data_item_count)","text":"Source code in src/omnipy/modules/fairtracks/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef import_dataset_from_encode(endpoints: Iterable[constr(min_length=1)],\n                               max_data_item_count: PositiveInt) -> JsonDataset:\n    dataset = JsonDataset()\n    for endpoint in endpoints:\n        dataset[endpoint] = encode_api(\n            endpoint,\n            limit=str(max_data_item_count),\n            format='json',\n        )\n    return dataset\n
"},{"location":"reference/omnipy/modules/general/","title":"general","text":""},{"location":"reference/omnipy/modules/general/models/","title":"models","text":""},{"location":"reference/omnipy/modules/general/models/#omnipy.modules.general.models.NotIteratorExceptStrings","title":"NotIteratorExceptStrings","text":"

Bases: Model[object]

Source code in src/omnipy/modules/general/models.py
class NotIteratorExceptStrings(Model[object]):\n    def _parse_data(cls, data: object) -> object:\n        assert isinstance(data, str) or not isinstance(data, Iterable)\n
"},{"location":"reference/omnipy/modules/general/tasks/","title":"tasks","text":""},{"location":"reference/omnipy/modules/general/tasks/#omnipy.modules.general.tasks.ModelT","title":"ModelT = TypeVar('ModelT', bound=Model) module-attribute","text":""},{"location":"reference/omnipy/modules/general/tasks/#omnipy.modules.general.tasks.cast_dataset","title":"cast_dataset(dataset, cast_model)","text":"Source code in src/omnipy/modules/general/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef cast_dataset(dataset: Dataset, cast_model: Callable[[], ModelT]) -> ModelT:\n    out_dataset: Dataset[ModelT] = Dataset[cast_model]()\n    for name, item in dataset.items():\n        out_dataset[name] = cast(cast_model, item.to_data())\n    return out_dataset\n
"},{"location":"reference/omnipy/modules/general/tasks/#omnipy.modules.general.tasks.import_directory","title":"import_directory(directory, exclude_prefixes=('.', '_'), include_suffixes=(), model=Model[str])","text":"Source code in src/omnipy/modules/general/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef import_directory(directory: str,\n                     exclude_prefixes: Tuple[str, ...] = ('.', '_'),\n                     include_suffixes: Tuple[str, ...] = (),\n                     model: Type[Model] = Model[str]) -> Dataset[Model]:\n    dataset = Dataset[model]()\n    for import_filename in os.listdir(directory):\n        if not exclude_prefixes or \\\n                not any(import_filename.startswith(prefix) for prefix in exclude_prefixes):\n            if not include_suffixes or \\\n                    any(import_filename.endswith(suffix) for suffix in include_suffixes):\n                with open(os.path.join(directory, import_filename)) as open_file:\n                    dataset_name = '_'.join(import_filename.split('.')[:-1])\n                    print(f\"{import_filename} -> Dataset['{dataset_name}']\")\n                    dataset[dataset_name] = open_file.read()\n    return dataset\n
"},{"location":"reference/omnipy/modules/general/tasks/#omnipy.modules.general.tasks.split_dataset","title":"split_dataset(dataset, datafile_names_for_b)","text":"Source code in src/omnipy/modules/general/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef split_dataset(\n        dataset: Dataset[Model[object]],\n        datafile_names_for_b: List[str]) -> Tuple[Dataset[Model[object]], Dataset[Model[object]]]:\n    model_cls = dataset.get_model_class()\n    datafile_names_for_a = set(dataset.keys()) - set(datafile_names_for_b)\n    dataset_a = Dataset[model_cls](  # type: ignore\n        {\n            name: dataset[name] for name in dataset.keys() if name in datafile_names_for_a\n        })\n    dataset_b = Dataset[model_cls](  # type: ignore\n        {\n            name: dataset[name] for name in dataset.keys() if name in datafile_names_for_b\n        })\n    return dataset_a, dataset_b\n
"},{"location":"reference/omnipy/modules/json/","title":"json","text":""},{"location":"reference/omnipy/modules/json/datasets/","title":"datasets","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonCustomDataset","title":"JsonCustomDataset: TypeAlias = JsonBaseDataset module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonDictOfAnyDataset","title":"JsonDictOfAnyDataset: TypeAlias = JsonBaseDataset[JsonDictOfAnyModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonDictOfDictsOfAnyDataset","title":"JsonDictOfDictsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonDictOfDictsOfAnyModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonDictOfDictsOfScalarsDataset","title":"JsonDictOfDictsOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonDictOfDictsOfScalarsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonDictOfListsOfAnyDataset","title":"JsonDictOfListsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonDictOfListsOfAnyModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonDictOfListsOfDictsOfAnyDataset","title":"JsonDictOfListsOfDictsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonDictOfListsOfDictsOfAnyModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonDictOfListsOfScalarsDataset","title":"JsonDictOfListsOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonDictOfListsOfScalarsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonDictOfScalarsDataset","title":"JsonDictOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonDictOfScalarsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonListOfAnyDataset","title":"JsonListOfAnyDataset: TypeAlias = JsonBaseDataset[JsonListOfAnyModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonListOfDictsOfAnyDataset","title":"JsonListOfDictsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonListOfDictsOfAnyModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonListOfDictsOfScalarsDataset","title":"JsonListOfDictsOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonListOfDictsOfScalarsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonListOfListsOfAnyDataset","title":"JsonListOfListsOfAnyDataset: TypeAlias = JsonBaseDataset[JsonListOfListsOfAnyModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonListOfListsOfScalarsDataset","title":"JsonListOfListsOfScalarsDataset: TypeAlias = JsonBaseDataset[JsonListOfListsOfScalarsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonListOfNestedDictsDataset","title":"JsonListOfNestedDictsDataset: TypeAlias = JsonBaseDataset[JsonListOfNestedDictsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonListOfScalarsDatabase","title":"JsonListOfScalarsDatabase: TypeAlias = JsonBaseDataset[JsonListOfScalarsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonModelT","title":"JsonModelT = TypeVar('JsonModelT', bound=Union[JsonModel, JsonListModel, JsonDictModel]) module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonNestedDictsDataset","title":"JsonNestedDictsDataset: TypeAlias = JsonBaseDataset[JsonNestedDictsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonBaseDataset","title":"JsonBaseDataset","text":"

Bases: Dataset[JsonModelT], Generic[JsonModelT]

Source code in src/omnipy/modules/json/datasets.py
class JsonBaseDataset(Dataset[JsonModelT], Generic[JsonModelT]):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/modules/json/datasets/#omnipy.modules.json.datasets.JsonDataset","title":"JsonDataset","text":"

Bases: JsonBaseDataset[JsonModel]

Source code in src/omnipy/modules/json/datasets.py
class JsonDataset(JsonBaseDataset[JsonModel]):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/modules/json/flows/","title":"flows","text":""},{"location":"reference/omnipy/modules/json/flows/#omnipy.modules.json.flows.flatten_nested_json","title":"flatten_nested_json(dataset, id_key, ref_key, default_key)","text":"Source code in src/omnipy/modules/json/flows.py
@mypy_fix_func_flow_template\n@FuncFlowTemplate(fixed_params=dict(id_key=ID_KEY, ref_key=REF_KEY, default_key=DEFAULT_KEY))\ndef flatten_nested_json(\n    dataset: JsonListOfDictsOfAnyDataset,\n    id_key: str,\n    ref_key: str,\n    default_key: str,\n) -> JsonListOfDictsOfScalarsDataset:\n    all_data_files_of_scalar_records_ds = JsonListOfDictsOfScalarsDataset()\n    data_files_of_any_ds = dataset\n\n    while len(data_files_of_any_ds) > 0:\n        data_files_of_scalar_records_ds, data_files_of_any_ds = \\\n            flatten_outer_level_of_all_data_files(\n                data_files_of_any_ds, id_key, ref_key, default_key)\n\n        all_data_files_of_scalar_records_ds |= data_files_of_scalar_records_ds\n\n    return all_data_files_of_scalar_records_ds\n
"},{"location":"reference/omnipy/modules/json/functions/","title":"functions","text":""},{"location":"reference/omnipy/modules/json/functions/#omnipy.modules.json.functions.add_references_to_parent_in_child_records","title":"add_references_to_parent_in_child_records(child, parent_title, ident, ref_key)","text":"Source code in src/omnipy/modules/json/functions.py
def add_references_to_parent_in_child_records(\n    child: JsonListOfDictsOfAny,\n    parent_title: str,\n    ident: str,\n    ref_key: str,\n):\n    ref_value = get_ref_value(parent_title, ident)\n    for new_nested_record in child:\n        ensure_item_first_in_nested_record(\n            new_nested_record, key=ref_key, value=ref_value, fail_if_present=True)\n
"},{"location":"reference/omnipy/modules/json/functions/#omnipy.modules.json.functions.ensure_item_first_in_nested_record","title":"ensure_item_first_in_nested_record(nested_record, key, value, fail_if_present=False)","text":"Source code in src/omnipy/modules/json/functions.py
def ensure_item_first_in_nested_record(\n    nested_record: JsonDictOfAny,\n    key: str,\n    value: str,\n    fail_if_present: bool = False,\n) -> str:\n    if key in nested_record:\n        assert not fail_if_present, f'Key \"{key}\" already present in dict'\n        del nested_record[key]\n\n    update_dict_from_front(nested_record, {key: value})\n\n    return value\n
"},{"location":"reference/omnipy/modules/json/functions/#omnipy.modules.json.functions.flatten_outer_level_of_nested_record","title":"flatten_outer_level_of_nested_record(nested_record, record_id, data_file_title, id_key, ref_key, default_key)","text":"Source code in src/omnipy/modules/json/functions.py
def flatten_outer_level_of_nested_record(\n    nested_record: JsonDictOfAny,\n    record_id: str,\n    data_file_title: str,\n    id_key: str,\n    ref_key: str,\n    default_key: str,\n) -> Tuple[JsonDictOfScalars, JsonDictOfListsOfDictsOfAny]:\n\n    record_id = ensure_item_first_in_nested_record(nested_record, key=id_key, value=record_id)\n\n    new_data_files: JsonDictOfListsOfDictsOfAny = JsonDictOfListsOfDictsOfAny()\n    records_of_scalars: JsonDictOfScalars = JsonDictOfScalars()\n\n    for key, value in nested_record.items():\n        if any(isinstance(value, typ) for typ in (dict, list)):\n            new_data_file_title: str = f'{data_file_title}.{key}'\n            new_data_file: JsonListOfDictsOfAny = transform_into_list_of_dicts(\n                cast(Union[JsonListOfAny, JsonDictOfAny], value), default_key=default_key)\n\n            add_references_to_parent_in_child_records(\n                child=new_data_file, parent_title=data_file_title, ident=record_id, ref_key=ref_key)\n\n            new_data_files[new_data_file_title] = new_data_file\n        else:\n            records_of_scalars[key] = cast(JsonScalar, value)\n\n    return records_of_scalars, new_data_files\n
"},{"location":"reference/omnipy/modules/json/functions/#omnipy.modules.json.functions.get_ref_value","title":"get_ref_value(data_file_title, ident)","text":"Source code in src/omnipy/modules/json/functions.py
def get_ref_value(data_file_title: str, ident: str) -> str:\n    return f'{data_file_title}.{ident}'\n
"},{"location":"reference/omnipy/modules/json/functions/#omnipy.modules.json.functions.transform_into_list_of_dicts","title":"transform_into_list_of_dicts(value, default_key)","text":"Source code in src/omnipy/modules/json/functions.py
def transform_into_list_of_dicts(value: Union[JsonListOfAny, JsonDictOfAny],\n                                 default_key: str) -> JsonListOfDictsOfAny:\n    if isinstance(value, JsonDict):\n        return JsonListOfDictsOfAny([value])\n    else:\n        ret_value = JsonListOfDictsOfAny()\n\n        for list_val in value:\n            if isinstance(list_val, dict):\n                ret_value.append(list_val)\n            else:\n                new_nested_record = JsonDictOfAny({default_key: list_val})\n                ret_value.append(new_nested_record)\n\n        return ret_value\n
"},{"location":"reference/omnipy/modules/json/functions/#omnipy.modules.json.functions.update_dict_from_front","title":"update_dict_from_front(dict_a, dict_b)","text":"Source code in src/omnipy/modules/json/functions.py
def update_dict_from_front(dict_a: Dict, dict_b: Dict) -> None:\n    dict_a_copy = copy(dict_a)\n    dict_a.clear()\n    dict_a.update(dict_b)\n    dict_a.update(dict_a_copy)\n
"},{"location":"reference/omnipy/modules/json/models/","title":"models","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.BaseT","title":"BaseT = TypeVar('BaseT', bound=Union[JsonScalar, 'JsonListModel', 'JsonDictModel', List, Dict]) module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonDictOfAnyModel","title":"JsonDictOfAnyModel: TypeAlias = JsonDictModel[JsonSubModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonDictOfDictsOfAnyModel","title":"JsonDictOfDictsOfAnyModel: TypeAlias = JsonDictModel[JsonDictModel[JsonSubModel]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonDictOfDictsOfScalarsModel","title":"JsonDictOfDictsOfScalarsModel: TypeAlias = JsonDictModel[JsonDictModel[JsonScalar]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonDictOfListsOfAnyModel","title":"JsonDictOfListsOfAnyModel: TypeAlias = JsonDictModel[JsonListModel[JsonSubModel]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonDictOfListsOfDictsOfAnyModel","title":"JsonDictOfListsOfDictsOfAnyModel: TypeAlias = JsonDictModel[JsonListOfDictsOfAnyModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonDictOfListsOfScalarsModel","title":"JsonDictOfListsOfScalarsModel: TypeAlias = JsonDictModel[JsonListModel[JsonScalar]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonDictOfScalarsModel","title":"JsonDictOfScalarsModel: TypeAlias = JsonDictModel[JsonScalar] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonListOfAnyModel","title":"JsonListOfAnyModel: TypeAlias = JsonListModel[JsonSubModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonListOfDictsOfAnyModel","title":"JsonListOfDictsOfAnyModel: TypeAlias = JsonListModel[JsonDictModel[JsonSubModel]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonListOfDictsOfScalarsModel","title":"JsonListOfDictsOfScalarsModel: TypeAlias = JsonListModel[JsonDictModel[JsonScalar]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonListOfListsOfAnyModel","title":"JsonListOfListsOfAnyModel: TypeAlias = JsonListModel[JsonListModel[JsonSubModel]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonListOfListsOfScalarsModel","title":"JsonListOfListsOfScalarsModel: TypeAlias = JsonListModel[JsonListModel[JsonScalar]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonListOfNestedDictsModel","title":"JsonListOfNestedDictsModel: TypeAlias = JsonListModel[JsonNestedDictsModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonListOfScalarsModel","title":"JsonListOfScalarsModel: TypeAlias = JsonListModel[JsonScalar] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonNestedDictsModel","title":"JsonNestedDictsModel: TypeAlias = JsonDictModel[JsonNoListsSubModel] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonNoListsSubModel","title":"JsonNoListsSubModel: TypeAlias = Union[JsonScalar, JsonDictModel['JsonNoListsSubModel']] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonSubModel","title":"JsonSubModel: TypeAlias = Union[JsonScalar, JsonListModel['JsonSubModel'], JsonDictModel['JsonSubModel']] module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonSubModelT","title":"JsonSubModelT = TypeVar('JsonSubModelT', bound=Union[JsonScalar, 'JsonListModel', 'JsonDictModel']) module-attribute","text":""},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonCustomModel","title":"JsonCustomModel","text":"

Bases: _JsonBaseModel[JsonSubModelT], Generic[JsonSubModelT]

Source code in src/omnipy/modules/json/models.py
class JsonCustomModel(_JsonBaseModel[JsonSubModelT], Generic[JsonSubModelT]):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonDictModel","title":"JsonDictModel","text":"

Bases: _JsonBaseModel[Dict[str, Optional[JsonSubModelT]]], Generic[JsonSubModelT]

Source code in src/omnipy/modules/json/models.py
class JsonDictModel(_JsonBaseModel[Dict[str, Optional[JsonSubModelT]]], Generic[JsonSubModelT]):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonListModel","title":"JsonListModel","text":"

Bases: _JsonBaseModel[List[Optional[JsonSubModelT]]], Generic[JsonSubModelT]

Source code in src/omnipy/modules/json/models.py
class JsonListModel(_JsonBaseModel[List[Optional[JsonSubModelT]]], Generic[JsonSubModelT]):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/modules/json/models/#omnipy.modules.json.models.JsonModel","title":"JsonModel","text":"

Bases: _JsonBaseModel[JsonSubModel]

Source code in src/omnipy/modules/json/models.py
class JsonModel(_JsonBaseModel[JsonSubModel]):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/modules/json/serializers/","title":"serializers","text":""},{"location":"reference/omnipy/modules/json/serializers/#omnipy.modules.json.serializers.JsonDatasetToTarFileSerializer","title":"JsonDatasetToTarFileSerializer","text":"

Bases: TarFileSerializer

Source code in src/omnipy/modules/json/serializers.py
class JsonDatasetToTarFileSerializer(TarFileSerializer):\n\"\"\"\"\"\"\n    @classmethod\n    def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:\n        return isinstance(dataset, JsonBaseDataset)\n\n    @classmethod\n    def get_dataset_cls_for_new(cls) -> Type[Dataset]:\n        return JsonDataset\n\n    @classmethod\n    def get_output_file_suffix(cls) -> str:\n        return 'json'\n\n    @classmethod\n    def serialize(cls, json_dataset: JsonDataset) -> Union[bytes, memoryview]:\n        def json_encode_func(json_data: JsonModel) -> bytes:\n            return json_data.json(indent=2).encode('utf8')\n\n        return cls.create_tarfile_from_dataset(json_dataset, data_encode_func=json_encode_func)\n\n    @classmethod\n    def deserialize(cls, tarfile_bytes: bytes) -> JsonDataset:\n        json_dataset = JsonDataset()\n\n        def json_decode_func(file_stream: IO[bytes]) -> str:\n            return file_stream.read().decode('utf8')\n\n        def json_dictify_object(obj_type: str, obj_val: str) -> Dict[str, str]:\n            return {f'{obj_type}': f'{obj_val}'}\n\n        cls.create_dataset_from_tarfile(\n            json_dataset,\n            tarfile_bytes,\n            data_decode_func=json_decode_func,\n            dictify_object_func=json_dictify_object,\n            import_method='from_json')\n\n        return json_dataset\n
"},{"location":"reference/omnipy/modules/json/serializers/#omnipy.modules.json.serializers.JsonDatasetToTarFileSerializer.deserialize","title":"deserialize(tarfile_bytes) classmethod","text":"Source code in src/omnipy/modules/json/serializers.py
@classmethod\ndef deserialize(cls, tarfile_bytes: bytes) -> JsonDataset:\n    json_dataset = JsonDataset()\n\n    def json_decode_func(file_stream: IO[bytes]) -> str:\n        return file_stream.read().decode('utf8')\n\n    def json_dictify_object(obj_type: str, obj_val: str) -> Dict[str, str]:\n        return {f'{obj_type}': f'{obj_val}'}\n\n    cls.create_dataset_from_tarfile(\n        json_dataset,\n        tarfile_bytes,\n        data_decode_func=json_decode_func,\n        dictify_object_func=json_dictify_object,\n        import_method='from_json')\n\n    return json_dataset\n
"},{"location":"reference/omnipy/modules/json/serializers/#omnipy.modules.json.serializers.JsonDatasetToTarFileSerializer.get_dataset_cls_for_new","title":"get_dataset_cls_for_new() classmethod","text":"Source code in src/omnipy/modules/json/serializers.py
@classmethod\ndef get_dataset_cls_for_new(cls) -> Type[Dataset]:\n    return JsonDataset\n
"},{"location":"reference/omnipy/modules/json/serializers/#omnipy.modules.json.serializers.JsonDatasetToTarFileSerializer.get_output_file_suffix","title":"get_output_file_suffix() classmethod","text":"Source code in src/omnipy/modules/json/serializers.py
@classmethod\ndef get_output_file_suffix(cls) -> str:\n    return 'json'\n
"},{"location":"reference/omnipy/modules/json/serializers/#omnipy.modules.json.serializers.JsonDatasetToTarFileSerializer.is_dataset_directly_supported","title":"is_dataset_directly_supported(dataset) classmethod","text":"Source code in src/omnipy/modules/json/serializers.py
@classmethod\ndef is_dataset_directly_supported(cls, dataset: Dataset) -> bool:\n    return isinstance(dataset, JsonBaseDataset)\n
"},{"location":"reference/omnipy/modules/json/serializers/#omnipy.modules.json.serializers.JsonDatasetToTarFileSerializer.serialize","title":"serialize(json_dataset) classmethod","text":"Source code in src/omnipy/modules/json/serializers.py
@classmethod\ndef serialize(cls, json_dataset: JsonDataset) -> Union[bytes, memoryview]:\n    def json_encode_func(json_data: JsonModel) -> bytes:\n        return json_data.json(indent=2).encode('utf8')\n\n    return cls.create_tarfile_from_dataset(json_dataset, data_encode_func=json_encode_func)\n
"},{"location":"reference/omnipy/modules/json/tasks/","title":"tasks","text":""},{"location":"reference/omnipy/modules/json/tasks/#omnipy.modules.json.tasks.DEFAULT_KEY","title":"DEFAULT_KEY = '__root__' module-attribute","text":""},{"location":"reference/omnipy/modules/json/tasks/#omnipy.modules.json.tasks.ID_KEY","title":"ID_KEY = '_omnipy_id' module-attribute","text":""},{"location":"reference/omnipy/modules/json/tasks/#omnipy.modules.json.tasks.REF_KEY","title":"REF_KEY = '_omnipy_ref' module-attribute","text":""},{"location":"reference/omnipy/modules/json/tasks/#omnipy.modules.json.tasks.convert_dataset_string_to_json","title":"convert_dataset_string_to_json(dataset)","text":"Source code in src/omnipy/modules/json/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef convert_dataset_string_to_json(dataset: Dataset[Model[str]]) -> JsonDataset:\n    json_dataset = JsonDataset()\n    json_dataset.from_json(dataset.to_data())\n    return json_dataset\n
"},{"location":"reference/omnipy/modules/json/tasks/#omnipy.modules.json.tasks.flatten_outer_level_of_all_data_files","title":"flatten_outer_level_of_all_data_files(dataset, id_key, ref_key, default_key)","text":"Source code in src/omnipy/modules/json/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef flatten_outer_level_of_all_data_files(\n        dataset: JsonListOfDictsOfAnyDataset, id_key: str, ref_key: str,\n        default_key: str) -> Tuple[JsonListOfDictsOfScalarsDataset, JsonListOfDictsOfAnyDataset]:\n\n    data_files_of_scalar_records: defaultdict[str, JsonListOfDictsOfScalars] = \\\n        defaultdict(JsonListOfDictsOfScalars)\n    data_files_of_any: defaultdict[str, JsonListOfDictsOfAny] = defaultdict(JsonListOfDictsOfAny)\n\n    dataset_as_data: JsonDictOfListsOfDictsOfAny = \\\n        cast(JsonDictOfListsOfDictsOfAny, dataset.to_data())\n\n    for data_file_title, item in dataset_as_data.items():\n        data_file: JsonListOfDictsOfAny = item\n\n        if len(data_file) == 0:\n            data_files_of_scalar_records[data_file_title] = JsonListOfDictsOfScalars()\n\n        for record_id, nested_record in enumerate(data_file):\n            record_of_scalars: JsonDictOfScalars\n            new_data_files_of_any: JsonDictOfListsOfDictsOfAny\n            record_of_scalars, new_data_files_of_any = flatten_outer_level_of_nested_record(\n                nested_record,\n                str(record_id),\n                data_file_title,\n                id_key,\n                ref_key,\n                default_key,\n            )\n\n            new_data_file_title: str\n            new_data_file_of_any: JsonListOfDictsOfAny\n            for new_data_file_title, new_data_file_of_any in new_data_files_of_any.items():\n                data_files_of_any[new_data_file_title] += new_data_file_of_any\n            data_files_of_scalar_records[data_file_title].append(record_of_scalars)\n\n    data_files_of_scalar_records_ds = JsonListOfDictsOfScalarsDataset(data_files_of_scalar_records)\n    data_files_of_any_ds = JsonListOfDictsOfAnyDataset(data_files_of_any)\n\n    return data_files_of_scalar_records_ds, data_files_of_any_ds\n
"},{"location":"reference/omnipy/modules/json/tasks/#omnipy.modules.json.tasks.transpose_dataset_of_dicts_to_lists","title":"transpose_dataset_of_dicts_to_lists(dataset, id_key=ID_KEY)","text":"Source code in src/omnipy/modules/json/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef transpose_dataset_of_dicts_to_lists(dataset: JsonDictOfAnyDataset,\n                                        id_key: str = ID_KEY) -> JsonListOfDictsOfAnyDataset:\n    output_dataset = JsonListOfDictsOfAnyDataset()\n    output_data = defaultdict(list)\n\n    for name, item in dataset.items():\n        for key, val in item.to_data().items():\n            if not isinstance(val, list):\n                val = [val]\n\n            for item_index, val_item in enumerate(val):\n                if isinstance(val_item, dict):\n                    data = {id_key: f'{name}_{item_index}'}\n                    assert id_key not in val_item\n                    data |= val_item\n                else:\n                    data = val_item\n                output_data[key].append(data)\n    output_dataset |= output_data.items()\n    return output_dataset\n
"},{"location":"reference/omnipy/modules/json/types/","title":"types","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.Json","title":"Json: TypeAlias = Union[JsonScalar, JsonList['Json'], JsonDict['Json']] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonDictOfAny","title":"JsonDictOfAny: TypeAlias = JsonDict[Json] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonDictOfDictsOfAny","title":"JsonDictOfDictsOfAny: TypeAlias = JsonDict[JsonDict[Json]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonDictOfDictsOfScalars","title":"JsonDictOfDictsOfScalars: TypeAlias = JsonDict[JsonDict[JsonScalar]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonDictOfListsOfAny","title":"JsonDictOfListsOfAny: TypeAlias = JsonDict[JsonList[Json]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonDictOfListsOfDictsOfAny","title":"JsonDictOfListsOfDictsOfAny: TypeAlias = JsonDict[JsonListOfDictsOfAny] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonDictOfListsOfScalars","title":"JsonDictOfListsOfScalars: TypeAlias = JsonDict[JsonList[JsonScalar]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonDictOfScalars","title":"JsonDictOfScalars: TypeAlias = JsonDict[JsonScalar] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonListOfAny","title":"JsonListOfAny: TypeAlias = JsonList[Json] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonListOfDictsOfAny","title":"JsonListOfDictsOfAny: TypeAlias = JsonList[JsonDict[Json]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonListOfDictsOfScalars","title":"JsonListOfDictsOfScalars: TypeAlias = JsonList[JsonDict[JsonScalar]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonListOfListsOfAny","title":"JsonListOfListsOfAny: TypeAlias = JsonList[JsonList[Json]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonListOfListsOfScalars","title":"JsonListOfListsOfScalars: TypeAlias = JsonList[JsonList[JsonScalar]] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonListOfNestedDicts","title":"JsonListOfNestedDicts: TypeAlias = JsonList[JsonNestedDicts] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonListOfScalars","title":"JsonListOfScalars: TypeAlias = JsonList[JsonScalar] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonNestedDicts","title":"JsonNestedDicts: TypeAlias = JsonDict[JsonNoLists] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonNoLists","title":"JsonNoLists: TypeAlias = Union[JsonScalar, JsonDict['JsonNoLists']] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonScalar","title":"JsonScalar: TypeAlias = Union[None, int, float, str, bool] module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonT","title":"JsonT = TypeVar('JsonT', bound=Union[JsonScalar, 'JsonList', 'JsonDict']) module-attribute","text":""},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonDict","title":"JsonDict","text":"

Bases: Dict[str, JsonT], Generic[JsonT]

Source code in src/omnipy/modules/json/types.py
class JsonDict(Dict[str, JsonT], Generic[JsonT]):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/modules/json/types/#omnipy.modules.json.types.JsonList","title":"JsonList","text":"

Bases: List[JsonT], Generic[JsonT]

Source code in src/omnipy/modules/json/types.py
class JsonList(List[JsonT], Generic[JsonT]):\n\"\"\"\"\"\"\n    ...\n
"},{"location":"reference/omnipy/modules/pandas/","title":"pandas","text":""},{"location":"reference/omnipy/modules/pandas/models/","title":"models","text":""},{"location":"reference/omnipy/modules/pandas/models/#omnipy.modules.pandas.models.ListOfPandasDatasetsWithSameNumberOfFiles","title":"ListOfPandasDatasetsWithSameNumberOfFiles","text":"

Bases: Model[List[PandasDataset]]

Source code in src/omnipy/modules/pandas/models.py
class ListOfPandasDatasetsWithSameNumberOfFiles(Model[List[PandasDataset]]):\n    @classmethod\n    def _parse_data(cls, dataset_list: List[PandasDataset]) -> Any:\n        assert len(dataset_list) >= 2\n        assert all(len(dataset) for dataset in dataset_list)\n
"},{"location":"reference/omnipy/modules/pandas/models/#omnipy.modules.pandas.models.PandasDataset","title":"PandasDataset","text":"

Bases: Dataset[PandasModel]

Source code in src/omnipy/modules/pandas/models.py
class PandasDataset(Dataset[PandasModel]):\n    ...\n
"},{"location":"reference/omnipy/modules/pandas/models/#omnipy.modules.pandas.models.PandasModel","title":"PandasModel","text":"

Bases: Model[pd.DataFrame]

Source code in src/omnipy/modules/pandas/models.py
class PandasModel(Model[pd.DataFrame]):\n    @classmethod\n    def _parse_data(cls, data: pd.DataFrame) -> pd.DataFrame:\n        cls._data_column_names_are_strings(data)\n        cls._data_not_empty_object(data)\n        return data\n\n    @staticmethod\n    def _data_column_names_are_strings(data: pd.DataFrame) -> None:\n        for column in data.columns:\n            assert isinstance(column, str)\n\n    @staticmethod\n    def _data_not_empty_object(data: pd.DataFrame) -> None:\n        assert not any(data.isna().all(axis=1))\n\n    def dict(self, *args, **kwargs) -> Dict[Any, Any]:\n        df = super().dict(*args, **kwargs)[ROOT_KEY]\n        df = df.replace({pd.NA: None})\n        return df.to_dict(orient='records')  # noqa\n\n    def from_data(self, value: Iterable[Any]) -> None:\n        self.contents = pd.DataFrame(value).convert_dtypes()\n\n    def from_json(self, value: str) -> None:\n        self.contents = pd.read_json(value).convert_dtypes()\n
"},{"location":"reference/omnipy/modules/pandas/models/#omnipy.modules.pandas.models.PandasModel.dict","title":"dict(*args, **kwargs)","text":"Source code in src/omnipy/modules/pandas/models.py
def dict(self, *args, **kwargs) -> Dict[Any, Any]:\n    df = super().dict(*args, **kwargs)[ROOT_KEY]\n    df = df.replace({pd.NA: None})\n    return df.to_dict(orient='records')  # noqa\n
"},{"location":"reference/omnipy/modules/pandas/models/#omnipy.modules.pandas.models.PandasModel.from_data","title":"from_data(value)","text":"Source code in src/omnipy/modules/pandas/models.py
def from_data(self, value: Iterable[Any]) -> None:\n    self.contents = pd.DataFrame(value).convert_dtypes()\n
"},{"location":"reference/omnipy/modules/pandas/models/#omnipy.modules.pandas.models.PandasModel.from_json","title":"from_json(value)","text":"Source code in src/omnipy/modules/pandas/models.py
def from_json(self, value: str) -> None:\n    self.contents = pd.read_json(value).convert_dtypes()\n
"},{"location":"reference/omnipy/modules/pandas/serializers/","title":"serializers","text":""},{"location":"reference/omnipy/modules/pandas/serializers/#omnipy.modules.pandas.serializers.PandasDatasetToTarFileSerializer","title":"PandasDatasetToTarFileSerializer","text":"

Bases: TarFileSerializer

Source code in src/omnipy/modules/pandas/serializers.py
class PandasDatasetToTarFileSerializer(TarFileSerializer):\n\"\"\"\"\"\"\n    @classmethod\n    def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:\n        return isinstance(dataset, PandasDataset)\n\n    @classmethod\n    def get_dataset_cls_for_new(cls) -> Type[Dataset]:\n        return PandasDataset\n\n    @classmethod\n    def get_output_file_suffix(cls) -> str:\n        return 'csv'\n\n    @classmethod\n    def serialize(cls, pandas_dataset: PandasDataset) -> Union[bytes, memoryview]:\n        assert isinstance(pandas_dataset, PandasDataset)\n\n        def pandas_encode_func(pandas_data: pd.DataFrame) -> memoryview:\n            csv_bytes = BytesIO()\n            pandas_data.to_csv(csv_bytes, encoding='utf8', mode='b', index=False)\n            return csv_bytes.getbuffer()\n\n        return cls.create_tarfile_from_dataset(pandas_dataset, data_encode_func=pandas_encode_func)\n\n    @classmethod\n    def deserialize(cls, tarfile_bytes: bytes) -> PandasDataset:\n        pandas_dataset = PandasDataset()\n\n        def csv_decode_func(file_stream: IO[bytes]) -> pd.DataFrame:\n            return pd.read_csv(file_stream, encoding='utf8')\n\n        def python_dictify_object(obj_type: str, obj_val: Any) -> Dict:\n            return {obj_type: obj_val}\n\n        cls.create_dataset_from_tarfile(\n            pandas_dataset,\n            tarfile_bytes,\n            data_decode_func=csv_decode_func,\n            dictify_object_func=python_dictify_object,\n            import_method='from_data')  # noqa\n\n        return pandas_dataset\n
"},{"location":"reference/omnipy/modules/pandas/serializers/#omnipy.modules.pandas.serializers.PandasDatasetToTarFileSerializer.deserialize","title":"deserialize(tarfile_bytes) classmethod","text":"Source code in src/omnipy/modules/pandas/serializers.py
@classmethod\ndef deserialize(cls, tarfile_bytes: bytes) -> PandasDataset:\n    pandas_dataset = PandasDataset()\n\n    def csv_decode_func(file_stream: IO[bytes]) -> pd.DataFrame:\n        return pd.read_csv(file_stream, encoding='utf8')\n\n    def python_dictify_object(obj_type: str, obj_val: Any) -> Dict:\n        return {obj_type: obj_val}\n\n    cls.create_dataset_from_tarfile(\n        pandas_dataset,\n        tarfile_bytes,\n        data_decode_func=csv_decode_func,\n        dictify_object_func=python_dictify_object,\n        import_method='from_data')  # noqa\n\n    return pandas_dataset\n
"},{"location":"reference/omnipy/modules/pandas/serializers/#omnipy.modules.pandas.serializers.PandasDatasetToTarFileSerializer.get_dataset_cls_for_new","title":"get_dataset_cls_for_new() classmethod","text":"Source code in src/omnipy/modules/pandas/serializers.py
@classmethod\ndef get_dataset_cls_for_new(cls) -> Type[Dataset]:\n    return PandasDataset\n
"},{"location":"reference/omnipy/modules/pandas/serializers/#omnipy.modules.pandas.serializers.PandasDatasetToTarFileSerializer.get_output_file_suffix","title":"get_output_file_suffix() classmethod","text":"Source code in src/omnipy/modules/pandas/serializers.py
@classmethod\ndef get_output_file_suffix(cls) -> str:\n    return 'csv'\n
"},{"location":"reference/omnipy/modules/pandas/serializers/#omnipy.modules.pandas.serializers.PandasDatasetToTarFileSerializer.is_dataset_directly_supported","title":"is_dataset_directly_supported(dataset) classmethod","text":"Source code in src/omnipy/modules/pandas/serializers.py
@classmethod\ndef is_dataset_directly_supported(cls, dataset: Dataset) -> bool:\n    return isinstance(dataset, PandasDataset)\n
"},{"location":"reference/omnipy/modules/pandas/serializers/#omnipy.modules.pandas.serializers.PandasDatasetToTarFileSerializer.serialize","title":"serialize(pandas_dataset) classmethod","text":"Source code in src/omnipy/modules/pandas/serializers.py
@classmethod\ndef serialize(cls, pandas_dataset: PandasDataset) -> Union[bytes, memoryview]:\n    assert isinstance(pandas_dataset, PandasDataset)\n\n    def pandas_encode_func(pandas_data: pd.DataFrame) -> memoryview:\n        csv_bytes = BytesIO()\n        pandas_data.to_csv(csv_bytes, encoding='utf8', mode='b', index=False)\n        return csv_bytes.getbuffer()\n\n    return cls.create_tarfile_from_dataset(pandas_dataset, data_encode_func=pandas_encode_func)\n
"},{"location":"reference/omnipy/modules/pandas/tasks/","title":"tasks","text":""},{"location":"reference/omnipy/modules/pandas/tasks/#omnipy.modules.pandas.tasks.concat_dataframes_across_datasets","title":"concat_dataframes_across_datasets(dataset_list, vertical=True)","text":"Source code in src/omnipy/modules/pandas/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef concat_dataframes_across_datasets(dataset_list: ListOfPandasDatasetsWithSameNumberOfFiles,\n                                      vertical=True) -> PandasDataset:\n    # We know from the data type that there are at least two datasets and that there is an equal\n    # amount of files/DataFrames in each dataset. This simplifies implementation.\n\n    out_dataset = PandasDataset()\n    out_datafile_names = tuple(dataset_list[0].keys())\n    for df_index in range(len(out_datafile_names)):\n        df = pd.concat([tuple(dataset.values())[df_index] for dataset in dataset_list],\n                       axis=0 if vertical else 1)\n        out_dataset[out_datafile_names[df_index]] = df\n    return out_dataset\n
"},{"location":"reference/omnipy/modules/pandas/tasks/#omnipy.modules.pandas.tasks.convert_dataset_csv_to_pandas","title":"convert_dataset_csv_to_pandas(dataset, delimiter=',', first_row_as_col_names=True, col_names=None, ignore_comments=True, comments_char='#')","text":"Source code in src/omnipy/modules/pandas/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef convert_dataset_csv_to_pandas(dataset: Dataset[Model[bytes]],\n                                  delimiter: str = ',',\n                                  first_row_as_col_names=True,\n                                  col_names: Optional[List[str]] = None,\n                                  ignore_comments: bool = True,\n                                  comments_char: str = '#') -> PandasDataset:\n    out_dataset = PandasDataset()\n    for key, item in dataset.items():\n        df = pd.read_csv(\n            StringIO(item),\n            sep=delimiter,\n            header='infer' if first_row_as_col_names else 0,\n            names=col_names,\n            comment=comments_char if ignore_comments else None,\n            encoding='utf8',\n        )\n        out_dataset[key] = df\n    return out_dataset\n
"},{"location":"reference/omnipy/modules/pandas/tasks/#omnipy.modules.pandas.tasks.convert_dataset_list_of_dicts_to_pandas","title":"convert_dataset_list_of_dicts_to_pandas(dataset)","text":"Source code in src/omnipy/modules/pandas/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef convert_dataset_list_of_dicts_to_pandas(\n        dataset: Dataset[Model[List[Dict[str, NotIteratorExceptStrings]]]]) -> PandasDataset:\n    pandas_dataset = PandasDataset()\n    pandas_dataset.from_data(dataset.to_data())\n    return pandas_dataset\n
"},{"location":"reference/omnipy/modules/pandas/tasks/#omnipy.modules.pandas.tasks.convert_dataset_pandas_to_csv","title":"convert_dataset_pandas_to_csv(dataset, delimiter=',', first_row_as_col_names=True, col_names=None)","text":"Source code in src/omnipy/modules/pandas/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef convert_dataset_pandas_to_csv(\n    dataset: PandasDataset,\n    delimiter: str = ',',\n    first_row_as_col_names=True,\n    col_names: Optional[List[str]] = None,\n) -> Dataset[Model[str]]:\n    out_dataset = Dataset[Model[str]]()\n    for key, df in dataset.items():\n        csv_stream = StringIO()\n        df.to_csv(\n            csv_stream,\n            sep=delimiter,\n            header=col_names if col_names else True if first_row_as_col_names else False,\n            encoding='utf8',\n            index=False)\n        out_dataset[key] = csv_stream.getvalue()\n    return out_dataset\n
"},{"location":"reference/omnipy/modules/pandas/tasks/#omnipy.modules.pandas.tasks.extract_columns_as_files","title":"extract_columns_as_files(dataset, col_names)","text":"Source code in src/omnipy/modules/pandas/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef extract_columns_as_files(dataset: PandasDataset, col_names: List[str]) -> PandasDataset:\n    out_dataset = PandasDataset()\n    for key, item in dataset.items():\n        df = dataset[key]\n        out_dataset[key] = df.loc[:, ~df.columns.isin(col_names)]\n\n        for col_name in col_names:\n            out_dataset[f'{key}.{col_name}'] = pd.DataFrame(df[col_name])\n    return out_dataset\n
"},{"location":"reference/omnipy/modules/prefect/","title":"prefect","text":""},{"location":"reference/omnipy/modules/prefect/#omnipy.modules.prefect.set_prefect_config_path","title":"set_prefect_config_path()","text":"Source code in src/omnipy/modules/prefect/__init__.py
def set_prefect_config_path():\n    prefect_module_dir = os.path.dirname(inspect.getabsfile(inspect.currentframe()))\n\n    os.environ['PREFECT_LOGGING_SETTINGS_PATH'] = \\\n        f\"{Path(prefect_module_dir).joinpath('settings', 'logging.yml')}\"\n
"},{"location":"reference/omnipy/modules/prefect/#omnipy.modules.prefect.use_local_api_for_tests","title":"use_local_api_for_tests()","text":"Source code in src/omnipy/modules/prefect/__init__.py
def use_local_api_for_tests():\n    if 'pytest' in sys.modules:\n        os.environ['PREFECT_API_KEY'] = ''\n        os.environ['PREFECT_API_URL'] = ''\n
"},{"location":"reference/omnipy/modules/prefect/engine/","title":"engine","text":""},{"location":"reference/omnipy/modules/prefect/engine/prefect/","title":"prefect","text":""},{"location":"reference/omnipy/modules/prefect/engine/prefect/#omnipy.modules.prefect.engine.prefect.PrefectEngine","title":"PrefectEngine","text":"

Bases: TaskRunnerEngine, LinearFlowRunnerEngine, DagFlowRunnerEngine, FuncFlowRunnerEngine

Job runner engine for Prefect

Source code in src/omnipy/modules/prefect/engine/prefect.py
class PrefectEngine(TaskRunnerEngine,\n                    LinearFlowRunnerEngine,\n                    DagFlowRunnerEngine,\n                    FuncFlowRunnerEngine):\n\"\"\"Job runner engine for Prefect\"\"\"\n    def _init_engine(self) -> None:\n        ...\n\n    def _update_from_config(self) -> None:\n        ...\n\n    @classmethod\n    def get_config_cls(cls) -> Type[IsPrefectEngineConfig]:\n        return PrefectEngineConfig\n\n    # TaskRunnerEngine\n\n    def _init_task(self, task: IsTask, call_func: Callable) -> PrefectTask:\n        assert isinstance(self._config, PrefectEngineConfig)\n        task_kwargs = dict(\n            name=task.name,\n            cache_key_fn=task_input_hash if self._config.use_cached_results else None,\n            cache_expiration=timedelta(days=1))\n\n        if task.has_coroutine_func():\n\n            @prefect_task(**task_kwargs)\n            async def run_task(*inner_args, **inner_kwargs):\n                return await call_func(*inner_args, **inner_kwargs)\n        else:\n\n            @prefect_task(**task_kwargs)\n            def run_task(*inner_args, **inner_kwargs):\n                return call_func(*inner_args, **inner_kwargs)\n\n        return run_task\n\n    def _run_task(self, state: PrefectTask, task: IsTask, call_func: Callable, *args,\n                  **kwargs) -> Any:\n\n        _prefect_task = state\n\n        if task.in_flow_context:\n            return _prefect_task(*args, **kwargs)\n        else:\n            flow_kwargs = dict(name=task.name)\n\n            if asyncio.iscoroutinefunction(_prefect_task):\n\n                @prefect_flow(**flow_kwargs)\n                async def task_flow(*inner_args, **inner_kwargs):\n                    return await resolve(_prefect_task(*inner_args, **inner_kwargs))\n            else:\n\n                @prefect_flow(**flow_kwargs)\n                def task_flow(*inner_args, **inner_kwargs):\n                    return _prefect_task(*inner_args, **inner_kwargs)\n\n            return task_flow(*args, **kwargs)\n\n    # LinearFlowRunnerEngine\n    def _init_linear_flow(self, linear_flow: IsLinearFlow) -> Any:\n        assert isinstance(self._config, PrefectEngineConfig)\n        flow_kwargs = dict(name=linear_flow.name,)\n        call_func = self.default_linear_flow_run_decorator(linear_flow)\n\n        if linear_flow.has_coroutine_func():\n\n            @prefect_flow(**flow_kwargs)\n            async def run_linear_flow(*inner_args, **inner_kwargs):\n                with linear_flow.flow_context:\n                    return await resolve(call_func(*inner_args, **inner_kwargs))\n        else:\n\n            @prefect_flow(**flow_kwargs)\n            def run_linear_flow(*inner_args, **inner_kwargs):\n                with linear_flow.flow_context:\n                    return call_func(*inner_args, **inner_kwargs)\n\n        return run_linear_flow\n\n    def _run_linear_flow(self, state: Any, linear_flow: IsLinearFlow, *args, **kwargs) -> Any:\n\n        _prefect_flow = state\n\n        return _prefect_flow(*args, **kwargs)\n\n    # DagFlowRunnerEngine\n\n    def _init_dag_flow(self, dag_flow: IsDagFlow) -> Any:\n\n        assert isinstance(self._config, PrefectEngineConfig)\n        flow_kwargs = dict(name=dag_flow.name,)\n        call_func = self.default_dag_flow_run_decorator(dag_flow)\n\n        if dag_flow.has_coroutine_func():\n\n            @prefect_flow(**flow_kwargs)\n            async def run_dag_flow(*inner_args, **inner_kwargs):\n                with dag_flow.flow_context:\n                    return await resolve(call_func(*inner_args, **inner_kwargs))\n        else:\n\n            @prefect_flow(**flow_kwargs)\n            def run_dag_flow(*inner_args, **inner_kwargs):\n                with dag_flow.flow_context:\n                    return call_func(*inner_args, **inner_kwargs)\n\n        return run_dag_flow\n\n    def _run_dag_flow(self, state: PrefectFlow, flow: IsDagFlow, *args, **kwargs) -> Any:\n\n        _prefect_flow = state\n\n        return _prefect_flow(*args, **kwargs)\n\n    # FuncFlowRunnerEngine\n\n    def _init_func_flow(self, func_flow: IsFuncFlow, call_func: Callable) -> object:\n\n        assert isinstance(self._config, PrefectEngineConfig)\n        flow_kwargs = dict(name=func_flow.name,)\n\n        if func_flow.has_coroutine_func():\n\n            @prefect_flow(**flow_kwargs)\n            async def run_func_flow(*inner_args, **inner_kwargs):\n                with func_flow.flow_context:\n                    return await resolve(call_func(*inner_args, **inner_kwargs))\n        else:\n\n            @prefect_flow(**flow_kwargs)\n            def run_func_flow(*inner_args, **inner_kwargs):\n                with func_flow.flow_context:\n                    return call_func(*inner_args, **inner_kwargs)\n\n        return run_func_flow\n\n    def _run_func_flow(self,\n                       state: Any,\n                       func_flow: IsFuncFlow,\n                       call_func: Callable,\n                       *args,\n                       **kwargs) -> Any:\n\n        _prefect_flow = state\n\n        return _prefect_flow(*args, **kwargs)\n
"},{"location":"reference/omnipy/modules/prefect/engine/prefect/#omnipy.modules.prefect.engine.prefect.PrefectEngine.get_config_cls","title":"get_config_cls() classmethod","text":"Source code in src/omnipy/modules/prefect/engine/prefect.py
@classmethod\ndef get_config_cls(cls) -> Type[IsPrefectEngineConfig]:\n    return PrefectEngineConfig\n
"},{"location":"reference/omnipy/modules/raw/","title":"raw","text":""},{"location":"reference/omnipy/modules/raw/protocols/","title":"protocols","text":""},{"location":"reference/omnipy/modules/raw/protocols/#omnipy.modules.raw.protocols.IsModifyAllLinesCallable","title":"IsModifyAllLinesCallable","text":"

Bases: Protocol

Source code in src/omnipy/modules/raw/protocols.py
class IsModifyAllLinesCallable(Protocol):\n\"\"\"\"\"\"\n    def __call__(self, all_lines: List[str], **kwargs: object) -> List[str]:\n        ...\n
"},{"location":"reference/omnipy/modules/raw/protocols/#omnipy.modules.raw.protocols.IsModifyAllLinesCallable.__call__","title":"__call__(all_lines, **kwargs)","text":"Source code in src/omnipy/modules/raw/protocols.py
def __call__(self, all_lines: List[str], **kwargs: object) -> List[str]:\n    ...\n
"},{"location":"reference/omnipy/modules/raw/protocols/#omnipy.modules.raw.protocols.IsModifyContentsCallable","title":"IsModifyContentsCallable","text":"

Bases: Protocol

Source code in src/omnipy/modules/raw/protocols.py
class IsModifyContentsCallable(Protocol):\n\"\"\"\"\"\"\n    def __call__(self, data_file: str, **kwargs: object) -> str:\n        ...\n
"},{"location":"reference/omnipy/modules/raw/protocols/#omnipy.modules.raw.protocols.IsModifyContentsCallable.__call__","title":"__call__(data_file, **kwargs)","text":"Source code in src/omnipy/modules/raw/protocols.py
def __call__(self, data_file: str, **kwargs: object) -> str:\n    ...\n
"},{"location":"reference/omnipy/modules/raw/protocols/#omnipy.modules.raw.protocols.IsModifyEachLineCallable","title":"IsModifyEachLineCallable","text":"

Bases: Protocol

Source code in src/omnipy/modules/raw/protocols.py
class IsModifyEachLineCallable(Protocol):\n\"\"\"\"\"\"\n    def __call__(self, line_no: int, line: str, **kwargs: object) -> str:\n        ...\n
"},{"location":"reference/omnipy/modules/raw/protocols/#omnipy.modules.raw.protocols.IsModifyEachLineCallable.__call__","title":"__call__(line_no, line, **kwargs)","text":"Source code in src/omnipy/modules/raw/protocols.py
def __call__(self, line_no: int, line: str, **kwargs: object) -> str:\n    ...\n
"},{"location":"reference/omnipy/modules/raw/serializers/","title":"serializers","text":""},{"location":"reference/omnipy/modules/raw/serializers/#omnipy.modules.raw.serializers.RawDatasetToTarFileSerializer","title":"RawDatasetToTarFileSerializer","text":"

Bases: TarFileSerializer

Source code in src/omnipy/modules/raw/serializers.py
class RawDatasetToTarFileSerializer(TarFileSerializer):\n\"\"\"\"\"\"\n    @classmethod\n    def is_dataset_directly_supported(cls, dataset: Dataset) -> bool:\n        return type(dataset) == Dataset[Model[str]]\n\n    @classmethod\n    def get_dataset_cls_for_new(cls) -> Type[Dataset]:\n        return Dataset[Model[str]]\n\n    @classmethod\n    def get_output_file_suffix(cls) -> str:\n        return 'raw'\n\n    @classmethod\n    def serialize(cls, dataset: Dataset[Model[str]]) -> bytes:\n        def raw_encode_func(contents: str) -> bytes:\n            return contents.encode('utf8')\n\n        return cls.create_tarfile_from_dataset(dataset, data_encode_func=raw_encode_func)\n\n    @classmethod\n    def deserialize(cls, tarfile_bytes: bytes) -> Dataset[Model[str]]:\n        dataset = Dataset[Model[str]]()\n\n        def raw_decode_func(file_stream: IO[bytes]) -> str:\n            return file_stream.read().decode('utf8')\n\n        def python_dictify_object(obj_type: str, obj_val: Any) -> Dict:\n            return {obj_type: obj_val}\n\n        cls.create_dataset_from_tarfile(\n            dataset,\n            tarfile_bytes,\n            data_decode_func=raw_decode_func,\n            dictify_object_func=python_dictify_object,\n            import_method='from_data')  # noqa\n\n        return dataset\n
"},{"location":"reference/omnipy/modules/raw/serializers/#omnipy.modules.raw.serializers.RawDatasetToTarFileSerializer.deserialize","title":"deserialize(tarfile_bytes) classmethod","text":"Source code in src/omnipy/modules/raw/serializers.py
@classmethod\ndef deserialize(cls, tarfile_bytes: bytes) -> Dataset[Model[str]]:\n    dataset = Dataset[Model[str]]()\n\n    def raw_decode_func(file_stream: IO[bytes]) -> str:\n        return file_stream.read().decode('utf8')\n\n    def python_dictify_object(obj_type: str, obj_val: Any) -> Dict:\n        return {obj_type: obj_val}\n\n    cls.create_dataset_from_tarfile(\n        dataset,\n        tarfile_bytes,\n        data_decode_func=raw_decode_func,\n        dictify_object_func=python_dictify_object,\n        import_method='from_data')  # noqa\n\n    return dataset\n
"},{"location":"reference/omnipy/modules/raw/serializers/#omnipy.modules.raw.serializers.RawDatasetToTarFileSerializer.get_dataset_cls_for_new","title":"get_dataset_cls_for_new() classmethod","text":"Source code in src/omnipy/modules/raw/serializers.py
@classmethod\ndef get_dataset_cls_for_new(cls) -> Type[Dataset]:\n    return Dataset[Model[str]]\n
"},{"location":"reference/omnipy/modules/raw/serializers/#omnipy.modules.raw.serializers.RawDatasetToTarFileSerializer.get_output_file_suffix","title":"get_output_file_suffix() classmethod","text":"Source code in src/omnipy/modules/raw/serializers.py
@classmethod\ndef get_output_file_suffix(cls) -> str:\n    return 'raw'\n
"},{"location":"reference/omnipy/modules/raw/serializers/#omnipy.modules.raw.serializers.RawDatasetToTarFileSerializer.is_dataset_directly_supported","title":"is_dataset_directly_supported(dataset) classmethod","text":"Source code in src/omnipy/modules/raw/serializers.py
@classmethod\ndef is_dataset_directly_supported(cls, dataset: Dataset) -> bool:\n    return type(dataset) == Dataset[Model[str]]\n
"},{"location":"reference/omnipy/modules/raw/serializers/#omnipy.modules.raw.serializers.RawDatasetToTarFileSerializer.serialize","title":"serialize(dataset) classmethod","text":"Source code in src/omnipy/modules/raw/serializers.py
@classmethod\ndef serialize(cls, dataset: Dataset[Model[str]]) -> bytes:\n    def raw_encode_func(contents: str) -> bytes:\n        return contents.encode('utf8')\n\n    return cls.create_tarfile_from_dataset(dataset, data_encode_func=raw_encode_func)\n
"},{"location":"reference/omnipy/modules/raw/tasks/","title":"tasks","text":""},{"location":"reference/omnipy/modules/raw/tasks/#omnipy.modules.raw.tasks.modify_all_lines","title":"modify_all_lines(data_file, modify_all_lines_func, **kwargs)","text":"Source code in src/omnipy/modules/raw/tasks.py
@mypy_fix_task_template\n@TaskTemplate(iterate_over_data_files=True)\ndef modify_all_lines(\n    data_file: str,\n    modify_all_lines_func: IsModifyAllLinesCallable,\n    **kwargs: object,\n) -> str:\n    all_lines = [line.strip() for line in StringIO(data_file)]\n    modified_lines = modify_all_lines_func(all_lines, **kwargs)\n    return os.linesep.join(modified_lines)\n
"},{"location":"reference/omnipy/modules/raw/tasks/#omnipy.modules.raw.tasks.modify_datafile_contents","title":"modify_datafile_contents(data_file, modify_contents_func, **kwargs)","text":"Source code in src/omnipy/modules/raw/tasks.py
@mypy_fix_task_template\n@TaskTemplate(iterate_over_data_files=True)\ndef modify_datafile_contents(\n    data_file: str,\n    modify_contents_func: IsModifyContentsCallable,\n    **kwargs: object,\n) -> str:\n    return modify_contents_func(data_file, **kwargs)\n
"},{"location":"reference/omnipy/modules/raw/tasks/#omnipy.modules.raw.tasks.modify_each_line","title":"modify_each_line(data_file, modify_line_func, **kwargs)","text":"Source code in src/omnipy/modules/raw/tasks.py
@mypy_fix_task_template\n@TaskTemplate(iterate_over_data_files=True)\ndef modify_each_line(\n    data_file: str,\n    modify_line_func: IsModifyEachLineCallable,\n    **kwargs: object,\n) -> str:\n    output_data = StringIO()\n    for i, line in enumerate(StringIO(data_file)):\n        modified_line = modify_line_func(i, line, **kwargs)\n        if modified_line is not None:\n            output_data.write(modified_line)\n    return output_data.getvalue()\n
"},{"location":"reference/omnipy/modules/tables/","title":"tables","text":""},{"location":"reference/omnipy/modules/tables/models/","title":"models","text":""},{"location":"reference/omnipy/modules/tables/models/#omnipy.modules.tables.models.JsonTableOfStrings","title":"JsonTableOfStrings","text":"

Bases: JsonListModel[JsonDictModel[str]]

Source code in src/omnipy/modules/tables/models.py
class JsonTableOfStrings(JsonListModel[JsonDictModel[str]]):\n    ...\n
"},{"location":"reference/omnipy/modules/tables/models/#omnipy.modules.tables.models.TableOfStrings","title":"TableOfStrings","text":"

Bases: Model[List[Dict[str, str]]]

Source code in src/omnipy/modules/tables/models.py
class TableOfStrings(Model[List[Dict[str, str]]]):\n    ...\n
"},{"location":"reference/omnipy/modules/tables/models/#omnipy.modules.tables.models.TableOfStringsAndLists","title":"TableOfStringsAndLists","text":"

Bases: Model[List[Dict[str, Union[str, List[str]]]]]

Source code in src/omnipy/modules/tables/models.py
class TableOfStringsAndLists(Model[List[Dict[str, Union[str, List[str]]]]]):\n    ...\n
"},{"location":"reference/omnipy/modules/tables/tasks/","title":"tasks","text":""},{"location":"reference/omnipy/modules/tables/tasks/#omnipy.modules.tables.tasks.remove_columns","title":"remove_columns(json_dataset, column_keys_for_data_items)","text":"Source code in src/omnipy/modules/tables/tasks.py
@mypy_fix_task_template\n@TaskTemplate()\ndef remove_columns(json_dataset: JsonListOfDictsOfAnyDataset,\n                   column_keys_for_data_items: Dict[str, List[str]]) -> JsonListOfDictsOfAnyDataset:\n    # TODO: implement general solution to make sure that one does not modify input data by\n    #       automatically copying or otherwise. Perhaps setting immutable/frozen option in pydantic,\n    #       if available?\n    #\n    dataset_copy = deepcopy(json_dataset)\n    for data_item_key, column_keys in column_keys_for_data_items.items():\n        for record in dataset_copy[data_item_key]:\n            for column in column_keys:\n                if column in record:\n                    del record[column]\n    return JsonListOfDictsOfAnyDataset(json_dataset.to_data())\n
"},{"location":"reference/omnipy/util/","title":"util","text":""},{"location":"reference/omnipy/util/callable_decorator_cls/","title":"callable_decorator_cls","text":""},{"location":"reference/omnipy/util/callable_decorator_cls/#omnipy.util.callable_decorator_cls.callable_decorator_cls","title":"callable_decorator_cls(cls)","text":"

\"Meta-decorator\" that allows any class to function as a decorator for a callable.

The only requirements are that 1) the first argument after self of the init() method needs to be annotated as a callable, and 2) the class must not already be callable (have a call() method).

Arguments and keyword arguments to the class decorator are supported.

Source code in src/omnipy/util/callable_decorator_cls.py
def callable_decorator_cls(cls: Type[DecoratorClassT]) -> IsCallableClass[DecoratorClassT]:\n\"\"\"\n    \"Meta-decorator\" that allows any class to function as a decorator for a callable.\n\n    The only requirements are that 1) the first argument after self of the __init__() method needs\n    to be annotated as a callable, and 2) the class must not already be callable (have a __call__()\n    method).\n\n    Arguments and keyword arguments to the class decorator are supported.\n    \"\"\"\n    if not isinstance(cls.__call__, MethodWrapperType):\n        cls._wrapped_call: Callable = cast(Callable, cls.__call__)\n\n    def _forward_call_to_obj_if_callable(self, *args: object,\n                                         **kwargs: object) -> Type[DecoratorClassT]:\n\"\"\"\n        __call__ method at the class level which forward the call to instance-level call methods,\n        if present (hardcoded as '_obj_call()'). This is needed due to the peculiarity that Python\n        only looks up special methods (with double underscores) at the class level, and not at the\n        instance level. Used in the decoration process to forward __call__ calls to the object level\n        _obj_call() methods, if present.\n\n        See: https://stackoverflow.com/q/33824228\n        \"\"\"\n        if hasattr(self, '_obj_call'):\n            return self._obj_call(*args, **kwargs)\n        if hasattr(self, '_wrapped_call'):\n            return self._wrapped_call(*args, **kwargs)\n        raise TypeError(\"'{}' object is not callable\".format(self.__class__.__name__))\n\n    setattr(cls, '__call__', _forward_call_to_obj_if_callable)\n\n    def _real_callable(arg: object) -> bool:\n\"\"\"\n        Helper method needed to ignore the class level __call__ method when checking whether the\n        decorated class is callable.\n        \"\"\"\n        if callable(arg):\n            if hasattr(arg, '__call__'):\n                if hasattr(arg.__call__, '__func__'):\n                    # due to mypy bug: https://github.com/python/mypy/issues/14123\n                    call_func_name = getattr(arg.__call__, '__func__').__name__\n\n                    if call_func_name == _forward_call_to_obj_if_callable.__name__:\n                        return False\n            return True\n        return False\n\n    _wrapped_new: Callable = cls.__new__\n\n    def _new_wrapper(cls, *args: object, **kwargs: object) -> DecoratorClassT:\n        if _wrapped_new is object.__new__:\n            obj = _wrapped_new(cls)\n        else:\n            obj = _wrapped_new(cls, *args, **kwargs)\n            # setattr(cls, '__new__', _wrapped_new)\n\n        _wrapped_init: IsCallableParamAfterSelf = cast(IsCallableParamAfterSelf,\n                                                       obj.__class__.__init__)\n\n        # Wrapper method that replaces the __init__ method of the decorated class\n        def _init_wrapper(self, *args: object, **kwargs: object) -> None:\n            args_list = list(args)\n\n            def _init(callable_arg: Callable) -> None:\n                _wrapped_init(self, callable_arg, *args_list, **kwargs)\n                update_wrapper(self, callable_arg, updated=[])\n\n            if len(args_list) == 1 and _real_callable(args_list[0]):\n                # Decorate the callable directly\n                _callable_arg: Callable = cast(Callable, args_list[0])\n                args_list.pop(0)\n                _init(_callable_arg)\n            else:\n                # Add an instance-level _obj_call method, which are again callable by the\n                # class-level __call__ method. When this method is called, the provided _callable_arg\n                # is decorated.\n                def _init_as_obj_call_method(\n                        self, _callable_arg: Callable) -> Type[DecoratorClassT]:  # noqa\n                    _init(_callable_arg)\n                    del self._obj_call\n                    return self\n\n                self._obj_call = _init_as_obj_call_method.__get__(self)\n\n            setattr(self.__class__, '__init__', _wrapped_init)\n\n        setattr(obj.__class__, '__init__', _init_wrapper)\n\n        return obj\n\n    setattr(cls, '__new__', _new_wrapper)\n\n    return cast(IsCallableClass[DecoratorClassT], cls)\n
"},{"location":"reference/omnipy/util/dataframe/","title":"dataframe","text":""},{"location":"reference/omnipy/util/dataframe/#omnipy.util.dataframe.extract_subtable_by_labels","title":"extract_subtable_by_labels(df, row_labels=None, col_labels=None, row_level=None, col_level=None)","text":"Source code in src/omnipy/util/dataframe.py
def extract_subtable_by_labels(df,\n                               row_labels=None,\n                               col_labels=None,\n                               row_level=None,\n                               col_level=None):\n    if row_labels:\n        rows = [df.xs(row, axis=0, level=row_level, drop_level=False) for row in row_labels]\n        df = pd.concat(rows)\n    if col_labels:\n        cols = [df.xs(col, axis=1, level=col_level, drop_level=False) for col in col_labels]\n        df = pd.concat(cols, axis=1)\n    return df\n
"},{"location":"reference/omnipy/util/dataframe/#omnipy.util.dataframe.select_from_labels","title":"select_from_labels(df, labels, axis, level, invert=False)","text":"Source code in src/omnipy/util/dataframe.py
def select_from_labels(df, labels, axis, level, invert=False):\n    assert axis in [0, 1]\n    assert level in [0, 1]\n\n    idx = df.index.levels[level] if axis == 0 else df.columns.levels[level]\n    filtered_idx = idx[~idx.isin(labels)] if invert else idx[idx.isin(labels)]\n    formatted_idx = tuple(filtered_idx)\n    return formatted_idx\n
"},{"location":"reference/omnipy/util/dataframe/#omnipy.util.dataframe.split_dataframe","title":"split_dataframe(df, row_labels_to_move, col_labels_to_move, row_level=1, col_level=0)","text":"Source code in src/omnipy/util/dataframe.py
def split_dataframe(df, row_labels_to_move, col_labels_to_move, row_level=1, col_level=0):\n    mv_rows = select_from_labels(df, row_labels_to_move, axis=0, level=row_level)\n    kp_rows = select_from_labels(df, row_labels_to_move, axis=0, level=row_level, invert=True)\n    mv_cols = select_from_labels(df, col_labels_to_move, axis=1, level=col_level)\n    kp_cols = select_from_labels(df, col_labels_to_move, axis=1, level=col_level, invert=True)\n\n    kp_df = extract_subtable_by_labels(df, kp_rows, kp_cols, row_level, col_level)\n    new_row_df = extract_subtable_by_labels(df, kp_rows, mv_cols, row_level, col_level)\n    new_col_df = extract_subtable_by_labels(df, mv_rows, kp_cols, row_level, col_level)\n    new_row_col_df = extract_subtable_by_labels(df, mv_rows, mv_cols, row_level, col_level)\n\n    return kp_df, new_row_df, new_col_df, new_row_col_df\n
"},{"location":"reference/omnipy/util/helpers/","title":"helpers","text":""},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.Dictable","title":"Dictable = Union[Mapping[object, object], Iterable[Tuple[object, object]]] module-attribute","text":""},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.as_dictable","title":"as_dictable(obj)","text":"Source code in src/omnipy/util/helpers.py
def as_dictable(obj: object) -> Optional[Dictable]:\n    def _is_iterable_of_tuple_pairs(obj_inner: object) -> bool:\n        return isinstance(obj_inner, Iterable) and \\\n            all(isinstance(el, tuple) and len(el) == 2 for el in obj_inner)\n\n    if isinstance(obj, Mapping) or _is_iterable_of_tuple_pairs(obj):\n        return cast(Dictable, obj)\n    else:\n        return None\n
"},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.create_merged_dict","title":"create_merged_dict(dictable_1, dictable_2)","text":"Source code in src/omnipy/util/helpers.py
def create_merged_dict(dictable_1: Dictable, dictable_2: Dictable) -> Dict[object, object]:\n    merged_dict = dictable_1 if isinstance(dictable_1, dict) else dict(dictable_1)\n    dict_2 = dictable_2 if isinstance(dictable_2, dict) else dict(dictable_2)\n    merged_dict |= dict_2\n    return merged_dict\n
"},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.generic_aware_issubclass_ignore_args","title":"generic_aware_issubclass_ignore_args(cls, cls_or_tuple)","text":"Source code in src/omnipy/util/helpers.py
def generic_aware_issubclass_ignore_args(cls, cls_or_tuple):\n    try:\n        return issubclass(cls, cls_or_tuple)\n    except TypeError:\n        return issubclass(get_origin(cls), cls_or_tuple)\n
"},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.get_bases","title":"get_bases(cls)","text":"Source code in src/omnipy/util/helpers.py
def get_bases(cls):\n    return get_generic_bases(cls) if is_generic_type(cls) else cls.__bases__\n
"},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.get_datetime_format","title":"get_datetime_format(locale=None)","text":"Source code in src/omnipy/util/helpers.py
def get_datetime_format(locale: Optional[LocaleType] = None) -> str:\n    pkg_locale.setlocale(pkg_locale.LC_ALL, locale)\n\n    if hasattr(pkg_locale, 'nl_langinfo'):  # noqa\n        datetime_format = pkg_locale.nl_langinfo(pkg_locale.D_T_FMT)\n    else:\n        datetime_format = '%a %b %e %X %Y'\n    return datetime_format\n
"},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.remove_none_vals","title":"remove_none_vals(**kwargs)","text":"Source code in src/omnipy/util/helpers.py
def remove_none_vals(**kwargs: object) -> Dict[object, object]:\n    return {key: val for key, val in kwargs.items() if val is not None}\n
"},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.repr_max_len","title":"repr_max_len(data, max_len=200)","text":"Source code in src/omnipy/util/helpers.py
def repr_max_len(data: object, max_len: int = 200):\n    repr_str = repr(data)\n    return f'{repr_str[:max_len]}...' if len(repr_str) > max_len else repr_str\n
"},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.resolve","title":"resolve(val) async","text":"Source code in src/omnipy/util/helpers.py
async def resolve(val):\n    return await val if inspect.isawaitable(val) else val\n
"},{"location":"reference/omnipy/util/helpers/#omnipy.util.helpers.transfer_generic_args_to_cls","title":"transfer_generic_args_to_cls(to_cls, from_generic_type)","text":"Source code in src/omnipy/util/helpers.py
def transfer_generic_args_to_cls(to_cls, from_generic_type):\n    try:\n        return to_cls[get_args(from_generic_type)]\n    except (TypeError, AttributeError):\n        return to_cls\n
"},{"location":"reference/omnipy/util/mixin/","title":"mixin","text":""},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.DynamicMixinAcceptor","title":"DynamicMixinAcceptor","text":"Source code in src/omnipy/util/mixin.py
class DynamicMixinAcceptor:\n    # Constants\n    WITH_MIXINS_CLS_PREFIX = 'WithMixins'\n\n    # Declarations needed by mypy\n    _orig_class: Type\n    _orig_init_signature: inspect.Signature\n    _mixin_classes: List[Type]\n    _init_params_per_mixin_cls: DefaultDict[str, DefaultDict[str, inspect.Parameter]]\n\n    def __class_getitem__(cls, item):\n        return super().__class_getitem__(item)\n\n    def __init_subclass__(cls, **kwargs):\n        super().__init_subclass__(**kwargs)\n\n        if DynamicMixinAcceptor in get_bases(cls) and cls.__init__ is object.__init__:\n            raise TypeError(\n                'Dynamic mixin acceptor class is required to define a __init__() method.')\n\n        cls._orig_init_signature = inspect.signature(cls.__init__)\n        cls._mixin_classes = []\n        cls._init_params_per_mixin_cls = defaultdict(defaultdict)\n\n    @classmethod\n    def _get_mixin_init_kwarg_params(cls) -> Dict[str, inspect.Parameter]:\n        return {\n            key: param for param_dict in cls._init_params_per_mixin_cls.values() for key,\n            param in param_dict.items()\n        }\n\n    @property\n    def _mixin_init_kwarg_params(self) -> Dict[str, inspect.Parameter]:\n        return self._get_mixin_init_kwarg_params()\n\n    @classmethod\n    def _get_mixin_init_kwarg_params_including_bases(cls) -> Dict[str, inspect.Parameter]:\n        all_mixin_init_kwarg_params: Dict[str, inspect.Parameter] = {}\n\n        base_list = list(cls.__mro__)\n        skip_bases = {'DynamicMixinAcceptor'}\n\n        for base in base_list:\n            if base.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX):\n                skip_bases.add(base.__name__[:-len(cls.WITH_MIXINS_CLS_PREFIX)])\n\n        cleaned_base_list = [\n            base for base in base_list\n            if issubclass(base, DynamicMixinAcceptor) and base.__name__ not in skip_bases\n        ]\n\n        for base in cleaned_base_list:\n            all_mixin_init_kwarg_params |= dict(base._get_mixin_init_kwarg_params().items())\n\n        return all_mixin_init_kwarg_params\n\n    @property\n    def _mixin_init_kwarg_params_including_bases(self) -> Dict[str, inspect.Parameter]:\n        return self._get_mixin_init_kwarg_params_including_bases()\n\n    @classmethod\n    def accept_mixin(cls, mixin_cls: Type) -> None:\n        cls._accept_mixin(mixin_cls, update=True)\n\n    @classmethod\n    def _accept_mixin(cls, mixin_cls: Type, update: bool):\n        cls._mixin_classes.append(mixin_cls)\n\n        if '__init__' in mixin_cls.__dict__:\n            cls._store_init_signature_params_for_mixin(mixin_cls)\n\n            if update:\n                cls._update_cls_init_signature_with_kwargs_all_mixin_kwargs()\n\n    @classmethod\n    def _store_init_signature_params_for_mixin(cls, mixin_cls):\n        for key, param in inspect.signature(mixin_cls.__init__).parameters.items():\n            if key != 'self':\n                if param.kind not in (param.KEYWORD_ONLY, param.VAR_KEYWORD):\n                    raise AttributeError(\n                        'All params in the signature of the __init__() method in a dynamic '\n                        'mixin class must be keyword-only or var-keyword '\n                        '(except for the \"self\" param)')\n                if param.kind == param.KEYWORD_ONLY:\n                    cls._init_params_per_mixin_cls[mixin_cls.__name__][key] = param\n\n    @classmethod\n    def _update_cls_init_signature_with_kwargs_all_mixin_kwargs(cls):\n        updated_init_signature = cls._get_updated_cls_init_signature_with_all_mixin_kwargs()\n\n        cls.__init__.__signature__ = updated_init_signature\n        if hasattr(cls, '_orig_class'):\n            cls._orig_class.__init____signature__ = updated_init_signature\n\n    @classmethod\n    def _get_updated_cls_init_signature_with_all_mixin_kwargs(cls):\n        orig_init_param_dict = cls._orig_init_signature.parameters\n        init_params = list(orig_init_param_dict.values())\n        opt_var_keyword_param = []\n\n        if init_params[-1].kind == inspect.Parameter.VAR_KEYWORD:\n            opt_var_keyword_param = [init_params[-1]]\n            init_params = init_params[:-1]\n\n        only_mixin_params = [\n            val for (key, val) in cls._get_mixin_init_kwarg_params_including_bases().items()\n            if key not in orig_init_param_dict\n        ]\n\n        updated_params = init_params + only_mixin_params + opt_var_keyword_param\n        return cls._orig_init_signature.replace(parameters=updated_params)\n\n    @classmethod\n    def reset_mixins(cls):\n        cls._mixin_classes.clear()\n        cls._init_params_per_mixin_cls.clear()\n        cls.__init__.__signature__ = cls._orig_init_signature\n\n    def __new__(cls, *args, **kwargs):\n        if not cls.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX):\n            cls_with_mixins = cls._create_subcls_inheriting_from_mixins_and_orig_cls()\n            obj = super(cls, cls_with_mixins).__new__(cls_with_mixins, *args, **kwargs)\n\n        else:\n            obj = object.__new__(cls)\n\n        cls._update_cls_init_signature_with_kwargs_all_mixin_kwargs()\n        return obj\n\n    @classmethod\n    def _create_subcls_inheriting_from_mixins_and_orig_cls(cls):\n\n        # TODO: Refactor this, and possibly elsewhere in class\n\n        def __init__(self, *args, **kwargs):\n            # print(f'__init__ for obj of class: {self.__class__.__name__}')\n            cls.__init__(self, *args, **kwargs)\n            mixin_kwargs_defaults = {}\n\n            for base in cls_with_mixins.__mro__:\n                if base == cls \\\n                        or base.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX) \\\n                        or base.__init__ is object.__init__:\n                    continue\n\n                mixin_kwargs = {}\n                contains_positional = False\n\n                for key, param in inspect.signature(base.__init__).parameters.items():\n                    if key != 'self':\n                        if param.kind == param.KEYWORD_ONLY:\n                            if key in kwargs:\n                                mixin_kwargs[key] = kwargs[key]\n                            elif key in mixin_kwargs_defaults:\n                                mixin_kwargs[key] = mixin_kwargs_defaults[key]\n                            else:\n                                mixin_kwargs_defaults[key] = param.default\n                        elif param.kind in (param.POSITIONAL_ONLY,\n                                            param.POSITIONAL_OR_KEYWORD,\n                                            param.VAR_POSITIONAL):\n                            contains_positional = True\n\n                if contains_positional:\n                    # print(f'Calling... {base.__name__}(args={args}, kwargs={mixin_kwargs})')\n                    base.__init__(self, *args, **mixin_kwargs)\n                else:\n                    # print(f'Calling... {base.__name__}(kwargs={mixin_kwargs})')\n                    base.__init__(self, **mixin_kwargs)\n\n        cls_bases = list(get_bases(cls))\n        if not cls.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX):\n            cls_bases = list(cls._mixin_classes) + cls_bases\n\n        cls_bases_with_mixins = []\n\n        for cls_base in cls_bases:\n\n            if cls._is_true_acceptor_subclass(cls_base):\n                cls_new_base = cls_base._create_subcls_inheriting_from_mixins_and_orig_cls()\n                cls_base = transfer_generic_args_to_cls(cls_new_base, cls_base)\n\n            cls_bases_with_mixins.append(cls_base)\n\n        def fill_ns(ns):\n            ns |= dict(__init__=__init__)\n            return ns\n\n        cls_with_mixins = types.new_class(\n            f'{cls.__name__}{cls.WITH_MIXINS_CLS_PREFIX}',\n            tuple([cls] + cls_bases_with_mixins),\n            {},\n            fill_ns,\n        )\n        cls_with_mixins.__module__ = cls.__module__\n\n        cls_with_mixins._orig_class = cls\n        cls_with_mixins._orig_init_signature = inspect.signature(cls.__init__)\n\n        for mixin_cls in cls._mixin_classes:\n            cls_with_mixins._accept_mixin(mixin_cls, update=False)\n\n        return cls_with_mixins\n\n    @staticmethod\n    def _is_true_acceptor_subclass(cls):\n        if cls == DynamicMixinAcceptor:\n            return False\n        return generic_aware_issubclass_ignore_args(cls, DynamicMixinAcceptor)\n
"},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.DynamicMixinAcceptor.WITH_MIXINS_CLS_PREFIX","title":"WITH_MIXINS_CLS_PREFIX = 'WithMixins' instance-attribute class-attribute","text":""},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.DynamicMixinAcceptor.__class_getitem__","title":"__class_getitem__(item)","text":"Source code in src/omnipy/util/mixin.py
def __class_getitem__(cls, item):\n    return super().__class_getitem__(item)\n
"},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.DynamicMixinAcceptor.__init_subclass__","title":"__init_subclass__(**kwargs)","text":"Source code in src/omnipy/util/mixin.py
def __init_subclass__(cls, **kwargs):\n    super().__init_subclass__(**kwargs)\n\n    if DynamicMixinAcceptor in get_bases(cls) and cls.__init__ is object.__init__:\n        raise TypeError(\n            'Dynamic mixin acceptor class is required to define a __init__() method.')\n\n    cls._orig_init_signature = inspect.signature(cls.__init__)\n    cls._mixin_classes = []\n    cls._init_params_per_mixin_cls = defaultdict(defaultdict)\n
"},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.DynamicMixinAcceptor.__new__","title":"__new__(*args, **kwargs)","text":"Source code in src/omnipy/util/mixin.py
def __new__(cls, *args, **kwargs):\n    if not cls.__name__.endswith(cls.WITH_MIXINS_CLS_PREFIX):\n        cls_with_mixins = cls._create_subcls_inheriting_from_mixins_and_orig_cls()\n        obj = super(cls, cls_with_mixins).__new__(cls_with_mixins, *args, **kwargs)\n\n    else:\n        obj = object.__new__(cls)\n\n    cls._update_cls_init_signature_with_kwargs_all_mixin_kwargs()\n    return obj\n
"},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.DynamicMixinAcceptor.accept_mixin","title":"accept_mixin(mixin_cls) classmethod","text":"Source code in src/omnipy/util/mixin.py
@classmethod\ndef accept_mixin(cls, mixin_cls: Type) -> None:\n    cls._accept_mixin(mixin_cls, update=True)\n
"},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.DynamicMixinAcceptor.reset_mixins","title":"reset_mixins() classmethod","text":"Source code in src/omnipy/util/mixin.py
@classmethod\ndef reset_mixins(cls):\n    cls._mixin_classes.clear()\n    cls._init_params_per_mixin_cls.clear()\n    cls.__init__.__signature__ = cls._orig_init_signature\n
"},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.IsMixin","title":"IsMixin","text":"

Bases: Protocol

Source code in src/omnipy/util/mixin.py
class IsMixin(Protocol):\n\"\"\"\"\"\"\n    def __init__(self, **kwargs: object) -> None:\n        ...\n
"},{"location":"reference/omnipy/util/mixin/#omnipy.util.mixin.IsMixin.__init__","title":"__init__(**kwargs)","text":"Source code in src/omnipy/util/mixin.py
def __init__(self, **kwargs: object) -> None:\n    ...\n
"},{"location":"reference/omnipy/util/param_key_mapper/","title":"param_key_mapper","text":""},{"location":"reference/omnipy/util/param_key_mapper/#omnipy.util.param_key_mapper.ParamKeyMapper","title":"ParamKeyMapper","text":"Source code in src/omnipy/util/param_key_mapper.py
class ParamKeyMapper:\n    def __init__(self, key_map: Mapping[str, str]):\n        self.key_map = dict(key_map)\n        self._inverse_key_map = {val: key for key, val in self.key_map.items()}\n\n        if len(self.key_map) != len(self._inverse_key_map):\n            raise ValueError('Some values were dropped when translating to the inverse key_map!')\n\n    def _get_key_map(self, inverse: bool):\n        return self._inverse_key_map if inverse else self.key_map\n\n    def map_matching_keys(self,\n                          params: Mapping[str, Any],\n                          inverse: bool,\n                          keep_non_matching_keys: bool):\n        key_map = self._get_key_map(inverse)\n        keys = params.keys() if keep_non_matching_keys else [\n            key for key in params if key in key_map\n        ]\n        return {key_map[key] if key in key_map else key: params[key] for key in keys}\n\n    def delete_matching_keys(self, params: Mapping[str, Any], inverse: bool):\n        key_map = self._get_key_map(inverse)\n        return {key: params[key] for key in params if key not in key_map}\n\n    def map_matching_keys_delete_inverse_matches_keep_rest(self,\n                                                           params: Mapping[str, Any],\n                                                           inverse: bool):\n        params = self.delete_matching_keys(params, not inverse)\n        params = self.map_matching_keys(params, inverse, keep_non_matching_keys=True)\n\n        return params\n
"},{"location":"reference/omnipy/util/param_key_mapper/#omnipy.util.param_key_mapper.ParamKeyMapper.key_map","title":"key_map = dict(key_map) instance-attribute","text":""},{"location":"reference/omnipy/util/param_key_mapper/#omnipy.util.param_key_mapper.ParamKeyMapper.__init__","title":"__init__(key_map)","text":"Source code in src/omnipy/util/param_key_mapper.py
def __init__(self, key_map: Mapping[str, str]):\n    self.key_map = dict(key_map)\n    self._inverse_key_map = {val: key for key, val in self.key_map.items()}\n\n    if len(self.key_map) != len(self._inverse_key_map):\n        raise ValueError('Some values were dropped when translating to the inverse key_map!')\n
"},{"location":"reference/omnipy/util/param_key_mapper/#omnipy.util.param_key_mapper.ParamKeyMapper.delete_matching_keys","title":"delete_matching_keys(params, inverse)","text":"Source code in src/omnipy/util/param_key_mapper.py
def delete_matching_keys(self, params: Mapping[str, Any], inverse: bool):\n    key_map = self._get_key_map(inverse)\n    return {key: params[key] for key in params if key not in key_map}\n
"},{"location":"reference/omnipy/util/param_key_mapper/#omnipy.util.param_key_mapper.ParamKeyMapper.map_matching_keys","title":"map_matching_keys(params, inverse, keep_non_matching_keys)","text":"Source code in src/omnipy/util/param_key_mapper.py
def map_matching_keys(self,\n                      params: Mapping[str, Any],\n                      inverse: bool,\n                      keep_non_matching_keys: bool):\n    key_map = self._get_key_map(inverse)\n    keys = params.keys() if keep_non_matching_keys else [\n        key for key in params if key in key_map\n    ]\n    return {key_map[key] if key in key_map else key: params[key] for key in keys}\n
"},{"location":"reference/omnipy/util/param_key_mapper/#omnipy.util.param_key_mapper.ParamKeyMapper.map_matching_keys_delete_inverse_matches_keep_rest","title":"map_matching_keys_delete_inverse_matches_keep_rest(params, inverse)","text":"Source code in src/omnipy/util/param_key_mapper.py
def map_matching_keys_delete_inverse_matches_keep_rest(self,\n                                                       params: Mapping[str, Any],\n                                                       inverse: bool):\n    params = self.delete_matching_keys(params, not inverse)\n    params = self.map_matching_keys(params, inverse, keep_non_matching_keys=True)\n\n    return params\n
"},{"location":"reference/omnipy/util/publisher/","title":"publisher","text":""},{"location":"reference/omnipy/util/publisher/#omnipy.util.publisher.DataPublisher","title":"DataPublisher dataclass","text":"Source code in src/omnipy/util/publisher.py
@dataclass\nclass DataPublisher:\n    _subscriptions: DefaultDict[str, List[Callable[[Any], None]]] = \\\n        field(default_factory=_subscribers_factory, init=False, repr=False)\n\n    def subscribe(self, config_item: str, callback_fun: Callable[[Any], None]):\n        if not hasattr(self, config_item):\n            raise AttributeError(f'No config items named \"{config_item}\"')\n        elif config_item.startswith('_'):\n            raise AttributeError(f'Subscribing to private member \"{config_item}\" not allowed')\n        else:\n            self._subscriptions[config_item].append(callback_fun)\n            callback_fun(getattr(self, config_item))\n\n    def unsubscribe_all(self) -> None:\n        self._subscriptions = _subscribers_factory()\n\n    def __setattr__(self, key, value):\n        super().__setattr__(key, value)\n\n        if key in self._subscriptions:\n            for callback_fun in self._subscriptions[key]:\n                callback_fun(value)\n
"},{"location":"reference/omnipy/util/publisher/#omnipy.util.publisher.DataPublisher.__setattr__","title":"__setattr__(key, value)","text":"Source code in src/omnipy/util/publisher.py
def __setattr__(self, key, value):\n    super().__setattr__(key, value)\n\n    if key in self._subscriptions:\n        for callback_fun in self._subscriptions[key]:\n            callback_fun(value)\n
"},{"location":"reference/omnipy/util/publisher/#omnipy.util.publisher.DataPublisher.subscribe","title":"subscribe(config_item, callback_fun)","text":"Source code in src/omnipy/util/publisher.py
def subscribe(self, config_item: str, callback_fun: Callable[[Any], None]):\n    if not hasattr(self, config_item):\n        raise AttributeError(f'No config items named \"{config_item}\"')\n    elif config_item.startswith('_'):\n        raise AttributeError(f'Subscribing to private member \"{config_item}\" not allowed')\n    else:\n        self._subscriptions[config_item].append(callback_fun)\n        callback_fun(getattr(self, config_item))\n
"},{"location":"reference/omnipy/util/publisher/#omnipy.util.publisher.DataPublisher.unsubscribe_all","title":"unsubscribe_all()","text":"Source code in src/omnipy/util/publisher.py
def unsubscribe_all(self) -> None:\n    self._subscriptions = _subscribers_factory()\n
"}]} \ No newline at end of file diff --git a/docs/mkdocs_site/sitemap.xml b/docs/mkdocs_site/sitemap.xml new file mode 100644 index 00000000..0f8724ef --- /dev/null +++ b/docs/mkdocs_site/sitemap.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/docs/mkdocs_site/sitemap.xml.gz b/docs/mkdocs_site/sitemap.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..d97cb1e1d60506c81d27c401560c698bb4a3b16e GIT binary patch literal 127 zcmV-_0D%7=iwFpDk7#59|8r?{Wo=<_E_iKh04<9_3V)_WXo8&M?ytk3HC}0~zlG)Vu`_ \ No newline at end of file diff --git a/docs/source/autoapi/omnipy/api/enums/index.rst b/docs/source/autoapi/omnipy/api/enums/index.rst new file mode 100644 index 00000000..262a7fd7 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/enums/index.rst @@ -0,0 +1,363 @@ + + +omnipy.api.enums +================ + +.. py:module:: omnipy.api.enums + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`PersistOutputsOptions ` + - \- + * - :py:obj:`RestoreOutputsOptions ` + - \- + * - :py:obj:`ConfigPersistOutputsOptions ` + - \- + * - :py:obj:`ConfigRestoreOutputsOptions ` + - \- + * - :py:obj:`EngineChoice ` + - \- + * - :py:obj:`RunState ` + - \- + * - :py:obj:`RunStateLogMessages ` + - \- + + + + +Classes +------- + + + +.. py:class:: PersistOutputsOptions + + Bases: :py:obj:`str`, :py:obj:`enum.Enum` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`DISABLED ` + - \- + * - :py:obj:`FOLLOW_CONFIG ` + - \- + * - :py:obj:`ENABLED ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: DISABLED + :value: 'disabled' + + + + .. py:attribute:: FOLLOW_CONFIG + :value: 'config' + + + + .. py:attribute:: ENABLED + :value: 'enabled' + + + + + + + +.. py:class:: RestoreOutputsOptions + + Bases: :py:obj:`str`, :py:obj:`enum.Enum` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`DISABLED ` + - \- + * - :py:obj:`FOLLOW_CONFIG ` + - \- + * - :py:obj:`AUTO_ENABLE_IGNORE_PARAMS ` + - \- + * - :py:obj:`FORCE_ENABLE_IGNORE_PARAMS ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: DISABLED + :value: 'disabled' + + + + .. py:attribute:: FOLLOW_CONFIG + :value: 'config' + + + + .. py:attribute:: AUTO_ENABLE_IGNORE_PARAMS + :value: 'auto_ignore_params' + + + + .. py:attribute:: FORCE_ENABLE_IGNORE_PARAMS + :value: 'force_ignore_params' + + + + + + + +.. py:class:: ConfigPersistOutputsOptions + + Bases: :py:obj:`str`, :py:obj:`enum.Enum` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`DISABLED ` + - \- + * - :py:obj:`ENABLE_FLOW_OUTPUTS ` + - \- + * - :py:obj:`ENABLE_FLOW_AND_TASK_OUTPUTS ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: DISABLED + :value: 'disabled' + + + + .. py:attribute:: ENABLE_FLOW_OUTPUTS + :value: 'flow' + + + + .. py:attribute:: ENABLE_FLOW_AND_TASK_OUTPUTS + :value: 'all' + + + + + + + +.. py:class:: ConfigRestoreOutputsOptions + + Bases: :py:obj:`str`, :py:obj:`enum.Enum` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`DISABLED ` + - \- + * - :py:obj:`AUTO_ENABLE_IGNORE_PARAMS ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: DISABLED + :value: 'disabled' + + + + .. py:attribute:: AUTO_ENABLE_IGNORE_PARAMS + :value: 'auto_ignore_params' + + + + + + + +.. py:class:: EngineChoice + + Bases: :py:obj:`str`, :py:obj:`enum.Enum` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`LOCAL ` + - \- + * - :py:obj:`PREFECT ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: LOCAL + :value: 'local' + + + + .. py:attribute:: PREFECT + :value: 'prefect' + + + + + + + +.. py:class:: RunState + + Bases: :py:obj:`enum.IntEnum` + + + + + .. py:class:: denominator + + the denominator of a rational number in lowest terms + + + + + + + .. py:class:: imag + + the imaginary part of a complex number + + + + + + + .. py:class:: numerator + + the numerator of a rational number in lowest terms + + + + + + + .. py:class:: real + + the real part of a complex number + + + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`INITIALIZED ` + - \- + * - :py:obj:`RUNNING ` + - \- + * - :py:obj:`FINISHED ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: INITIALIZED + :value: 1 + + + + .. py:attribute:: RUNNING + :value: 2 + + + + .. py:attribute:: FINISHED + :value: 3 + + + + + + + +.. py:class:: RunStateLogMessages + + Bases: :py:obj:`str`, :py:obj:`enum.Enum` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`INITIALIZED ` + - \- + * - :py:obj:`RUNNING ` + - \- + * - :py:obj:`FINISHED ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: INITIALIZED + :value: 'Initialized "{}"' + + + + .. py:attribute:: RUNNING + :value: 'Started running "{}"...' + + + + .. py:attribute:: FINISHED + :value: 'Finished running "{}"!' + + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/exceptions/index.rst b/docs/source/autoapi/omnipy/api/exceptions/index.rst new file mode 100644 index 00000000..976cdde0 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/exceptions/index.rst @@ -0,0 +1,16 @@ + + +omnipy.api.exceptions +===================== + +.. py:module:: omnipy.api.exceptions + + +Overview +-------- + + + + + + diff --git a/docs/source/autoapi/omnipy/api/index.rst b/docs/source/autoapi/omnipy/api/index.rst new file mode 100644 index 00000000..b5d99f5a --- /dev/null +++ b/docs/source/autoapi/omnipy/api/index.rst @@ -0,0 +1,28 @@ + + +omnipy.api +========== + +.. py:module:: omnipy.api + + +Subpackages +----------- +.. toctree:: + :titlesonly: + :maxdepth: 3 + + protocols/index.rst + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + enums/index.rst + exceptions/index.rst + types/index.rst + + diff --git a/docs/source/autoapi/omnipy/api/protocols/index.rst b/docs/source/autoapi/omnipy/api/protocols/index.rst new file mode 100644 index 00000000..6e165521 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/index.rst @@ -0,0 +1,18 @@ + + +omnipy.api.protocols +==================== + +.. py:module:: omnipy.api.protocols + + +Subpackages +----------- +.. toctree:: + :titlesonly: + :maxdepth: 3 + + private/index.rst + public/index.rst + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/compute/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/compute/index.rst new file mode 100644 index 00000000..83b3bec6 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/compute/index.rst @@ -0,0 +1,19 @@ + + +omnipy.api.protocols.private.compute +==================================== + +.. py:module:: omnipy.api.protocols.private.compute + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + job/index.rst + job_creator/index.rst + mixins/index.rst + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/compute/job/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/compute/job/index.rst new file mode 100644 index 00000000..109d8253 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/compute/job/index.rst @@ -0,0 +1,580 @@ + + +omnipy.api.protocols.private.compute.job +======================================== + +.. py:module:: omnipy.api.protocols.private.compute.job + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsJobBase ` + - \- + * - :py:obj:`IsJob ` + - \- + * - :py:obj:`IsJobTemplate ` + - \- + * - :py:obj:`IsFuncArgJobBase ` + - \- + * - :py:obj:`IsPlainFuncArgJobBase ` + - \- + * - :py:obj:`IsFuncArgJob ` + - \- + * - :py:obj:`IsFuncArgJobTemplateCallable ` + - \- + * - :py:obj:`IsFuncArgJobTemplate ` + - \- + * - :py:obj:`IsTaskTemplateArgsJobBase ` + - \- + * - :py:obj:`IsTaskTemplateArgsJob ` + - \- + * - :py:obj:`IsTaskTemplateArgsJobTemplateCallable ` + - \- + * - :py:obj:`IsTaskTemplateArgsJobTemplate ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsJobBase(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.log.CanLog`, :py:obj:`omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + + + + +.. py:class:: IsJob(*, name: Optional[str] = None) + + Bases: :py:obj:`IsJobBase`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + + + + +.. py:class:: IsJobTemplate(*, name: Optional[str] = None) + + Bases: :py:obj:`IsJobBase`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + + + + +.. py:class:: IsFuncArgJobBase(*, name: Optional[str] = None) + + Bases: :py:obj:`IsJob`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + + + + +.. py:class:: IsPlainFuncArgJobBase + + Bases: :py:obj:`Protocol` + + + + + + +.. py:class:: IsFuncArgJob(*, name: Optional[str] = None) + + Bases: :py:obj:`IsFuncArgJobBase`, :py:obj:`Protocol`\ [\ :py:obj:`omnipy.api.types.JobT`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`revise `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: revise() -> omnipy.api.types.JobT + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + + + + +.. py:class:: IsFuncArgJobTemplateCallable + + Bases: :py:obj:`Protocol`\ [\ :py:obj:`omnipy.api.types.JobTemplateT`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`__call__ `\ (name, iterate_over_data_files, persist_outputs, restore_outputs, result_key, fixed_params, param_key_map, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: __call__(name: Optional[str] = None, iterate_over_data_files: bool = False, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None, result_key: Optional[str] = None, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None, **kwargs: object) -> Callable[[Callable], omnipy.api.types.JobTemplateT] + + + + + + +.. py:class:: IsFuncArgJobTemplate(*, name: Optional[str] = None) + + Bases: :py:obj:`IsJobTemplate`, :py:obj:`IsFuncArgJobBase`, :py:obj:`Protocol`\ [\ :py:obj:`omnipy.api.types.JobTemplateT`\ , :py:obj:`omnipy.api.types.JobT`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`refine `\ (\*args, update, name, iterate_over_data_files, persist_outputs, restore_outputs, result_key, fixed_params, param_key_map, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: refine(*args: Any, update: bool = True, name: Optional[str] = None, iterate_over_data_files: bool = False, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None, result_key: Optional[str] = None, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None, **kwargs: object) -> omnipy.api.types.JobTemplateT + + + .. py:method:: apply() -> omnipy.api.types.JobT + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + + + + +.. py:class:: IsTaskTemplateArgsJobBase(*, name: Optional[str] = None) + + Bases: :py:obj:`IsFuncArgJobBase`, :py:obj:`Protocol`\ [\ :py:obj:`omnipy.api.types.TaskTemplateCovT`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + + + + +.. py:class:: IsTaskTemplateArgsJob(*, name: Optional[str] = None) + + Bases: :py:obj:`IsTaskTemplateArgsJobBase`\ [\ :py:obj:`omnipy.api.types.TaskTemplateCovT`\ ], :py:obj:`IsFuncArgJob`\ [\ :py:obj:`omnipy.api.types.JobT`\ ], :py:obj:`Protocol`\ [\ :py:obj:`omnipy.api.types.TaskTemplateCovT`\ , :py:obj:`omnipy.api.types.JobT`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`revise `\ () + - \- + + + .. rubric:: Members + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: revise() -> omnipy.api.types.JobT + + + + + + +.. py:class:: IsTaskTemplateArgsJobTemplateCallable + + Bases: :py:obj:`Protocol`\ [\ :py:obj:`omnipy.api.types.TaskTemplateContraT`\ , :py:obj:`omnipy.api.types.JobTemplateT`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`__call__ `\ (\*task_templates, name, iterate_over_data_files, persist_outputs, restore_outputs, result_key, fixed_params, param_key_map, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: __call__(*task_templates: omnipy.api.types.TaskTemplateContraT, name: Optional[str] = None, iterate_over_data_files: bool = False, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None, result_key: Optional[str] = None, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None, **kwargs: object) -> Callable[[Callable], omnipy.api.types.JobTemplateT] + + + + + + +.. py:class:: IsTaskTemplateArgsJobTemplate(*, name: Optional[str] = None) + + Bases: :py:obj:`IsFuncArgJobTemplate`\ [\ :py:obj:`omnipy.api.types.JobTemplateT`\ , :py:obj:`omnipy.api.types.JobT`\ ], :py:obj:`IsTaskTemplateArgsJobBase`\ [\ :py:obj:`omnipy.api.types.TaskTemplateT`\ ], :py:obj:`Protocol`\ [\ :py:obj:`omnipy.api.types.TaskTemplateT`\ , :py:obj:`omnipy.api.types.JobTemplateT`\ , :py:obj:`omnipy.api.types.JobT`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`refine `\ (\*task_templates, update, name, iterate_over_data_files, fixed_params, param_key_map, result_key, persist_outputs, restore_outputs, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: refine(*task_templates: omnipy.api.types.TaskTemplateT, update: bool = True, name: Optional[str] = None, iterate_over_data_files: bool = False, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None, result_key: Optional[str] = None, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None, **kwargs: object) -> omnipy.api.types.JobTemplateT + + + .. py:method:: apply() -> omnipy.api.types.JobT + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/compute/job_creator/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/compute/job_creator/index.rst new file mode 100644 index 00000000..4fa91ef1 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/compute/job_creator/index.rst @@ -0,0 +1,92 @@ + + +omnipy.api.protocols.private.compute.job_creator +================================================ + +.. py:module:: omnipy.api.protocols.private.compute.job_creator + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsJobConfigHolder ` + - \- + * - :py:obj:`IsJobCreator ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsJobConfigHolder + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_engine `\ (engine) + - \- + + + .. rubric:: Members + + .. py:method:: set_config(config: omnipy.api.protocols.private.config.IsJobConfigBase) -> None + + + .. py:method:: set_engine(engine: omnipy.api.protocols.private.engine.IsEngine) -> None + + + + + + +.. py:class:: IsJobCreator + + Bases: :py:obj:`omnipy.api.protocols.private.compute.mixins.IsNestedContext`, :py:obj:`IsJobConfigHolder`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_engine `\ (engine) + - \- + + + .. rubric:: Members + + .. py:method:: set_config(config: omnipy.api.protocols.private.config.IsJobConfigBase) -> None + + + .. py:method:: set_engine(engine: omnipy.api.protocols.private.engine.IsEngine) -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/compute/mixins/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/compute/mixins/index.rst new file mode 100644 index 00000000..b7559b17 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/compute/mixins/index.rst @@ -0,0 +1,65 @@ + + +omnipy.api.protocols.private.compute.mixins +=========================================== + +.. py:module:: omnipy.api.protocols.private.compute.mixins + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsUniquelyNamedJob ` + - \- + * - :py:obj:`IsNestedContext ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsUniquelyNamedJob(*, name: Optional[str] = None) + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: regenerate_unique_name() -> None + + + + + + +.. py:class:: IsNestedContext + + Bases: :py:obj:`Protocol` + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/config/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/config/index.rst new file mode 100644 index 00000000..48a8e69c --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/config/index.rst @@ -0,0 +1,37 @@ + + +omnipy.api.protocols.private.config +=================================== + +.. py:module:: omnipy.api.protocols.private.config + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsJobConfigBase ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsJobConfigBase + + Bases: :py:obj:`Protocol` + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/engine/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/engine/index.rst new file mode 100644 index 00000000..9aa4527f --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/engine/index.rst @@ -0,0 +1,76 @@ + + +omnipy.api.protocols.private.engine +=================================== + +.. py:module:: omnipy.api.protocols.private.engine + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsEngine ` + - \- + * - :py:obj:`IsEngineConfig ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsEngine + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` \- + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: get_config_cls() -> Type[IsEngineConfig] + :classmethod: + + + .. py:method:: set_config(config: IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + +.. py:class:: IsEngineConfig + + Bases: :py:obj:`Protocol` + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/index.rst new file mode 100644 index 00000000..7c6ac8b4 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/index.rst @@ -0,0 +1,29 @@ + + +omnipy.api.protocols.private +============================ + +.. py:module:: omnipy.api.protocols.private + + +Subpackages +----------- +.. toctree:: + :titlesonly: + :maxdepth: 3 + + compute/index.rst + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + config/index.rst + engine/index.rst + log/index.rst + util/index.rst + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/log/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/log/index.rst new file mode 100644 index 00000000..ee321805 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/log/index.rst @@ -0,0 +1,97 @@ + + +omnipy.api.protocols.private.log +================================ + +.. py:module:: omnipy.api.protocols.private.log + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`CanLog ` + - \- + * - :py:obj:`IsRunStateRegistry ` + - \- + + + + +Classes +------- + + + +.. py:class:: CanLog + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + + + .. rubric:: Members + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + + + + +.. py:class:: IsRunStateRegistry + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`get_job_state `\ (job) + - \- + * - :py:obj:`get_job_state_datetime `\ (job, state) + - \- + * - :py:obj:`all_jobs `\ (state) + - \- + * - :py:obj:`set_job_state `\ (job, state) + - \- + + + .. rubric:: Members + + .. py:method:: get_job_state(job: omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob) -> omnipy.api.enums.RunState + + + .. py:method:: get_job_state_datetime(job: omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob, state: omnipy.api.enums.RunState) -> datetime.datetime + + + .. py:method:: all_jobs(state: Optional[omnipy.api.enums.RunState] = None) -> Tuple[omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob, Ellipsis] + + + .. py:method:: set_job_state(job: omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob, state: omnipy.api.enums.RunState) -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/private/util/index.rst b/docs/source/autoapi/omnipy/api/protocols/private/util/index.rst new file mode 100644 index 00000000..c1635f11 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/private/util/index.rst @@ -0,0 +1,82 @@ + + +omnipy.api.protocols.private.util +================================= + +.. py:module:: omnipy.api.protocols.private.util + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsCallableParamAfterSelf ` + - \- + * - :py:obj:`IsCallableClass ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsCallableParamAfterSelf + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`__call__ `\ (callable_arg, /None, \*args, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: __call__(callable_arg: Callable, /, *args: object, **kwargs: object) -> None + + + + + + +.. py:class:: IsCallableClass + + Bases: :py:obj:`Protocol`\ [\ :py:obj:`omnipy.api.types.DecoratorClassT`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: __call__(*args: object, **kwargs: object) -> Callable[[Callable], omnipy.api.types.DecoratorClassT] + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/public/compute/index.rst b/docs/source/autoapi/omnipy/api/protocols/public/compute/index.rst new file mode 100644 index 00000000..9c01b38c --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/public/compute/index.rst @@ -0,0 +1,566 @@ + + +omnipy.api.protocols.public.compute +=================================== + +.. py:module:: omnipy.api.protocols.public.compute + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsTaskTemplate ` + - Loosely coupled type replacement for the :py:class:`~omnipy.compute.task.TaskTemplate` class + * - :py:obj:`IsTask ` + - \- + * - :py:obj:`IsFlowTemplate ` + - \- + * - :py:obj:`IsFlow ` + - \- + * - :py:obj:`IsLinearFlowTemplate ` + - \- + * - :py:obj:`IsLinearFlow ` + - \- + * - :py:obj:`IsDagFlowTemplate ` + - \- + * - :py:obj:`IsDagFlow ` + - \- + * - :py:obj:`IsFuncFlowTemplate ` + - \- + * - :py:obj:`IsFuncFlow ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsTaskTemplate(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplate`\ [\ :py:obj:`IsTaskTemplate`\ , :py:obj:`IsTask`\ ], :py:obj:`Protocol` + + Loosely coupled type replacement for the :py:class:`~omnipy.compute.task.TaskTemplate` class + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`refine `\ (\*args, update, name, iterate_over_data_files, persist_outputs, restore_outputs, result_key, fixed_params, param_key_map, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: refine(*args: Any, update: bool = True, name: Optional[str] = None, iterate_over_data_files: bool = False, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None, result_key: Optional[str] = None, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None, **kwargs: object) -> omnipy.api.types.JobTemplateT + + + .. py:method:: apply() -> omnipy.api.types.JobT + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + + + + +.. py:class:: IsTask(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.compute.job.IsFuncArgJob`\ [\ :py:obj:`IsTaskTemplate`\ ], :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`revise `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: revise() -> omnipy.api.types.JobT + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + + + + +.. py:class:: IsFlowTemplate + + Bases: :py:obj:`Protocol` + + + + + + +.. py:class:: IsFlow + + Bases: :py:obj:`Protocol` + + + + + + +.. py:class:: IsLinearFlowTemplate(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobTemplate`\ [\ :py:obj:`IsTaskTemplate`\ , :py:obj:`IsLinearFlowTemplate`\ , :py:obj:`IsLinearFlow`\ ], :py:obj:`IsFlowTemplate`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`refine `\ (\*task_templates, update, name, iterate_over_data_files, fixed_params, param_key_map, result_key, persist_outputs, restore_outputs, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: refine(*task_templates: omnipy.api.types.TaskTemplateT, update: bool = True, name: Optional[str] = None, iterate_over_data_files: bool = False, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None, result_key: Optional[str] = None, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None, **kwargs: object) -> omnipy.api.types.JobTemplateT + + + .. py:method:: apply() -> omnipy.api.types.JobT + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + + + + +.. py:class:: IsLinearFlow(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJob`\ [\ :py:obj:`IsTaskTemplate`\ , :py:obj:`IsLinearFlowTemplate`\ ], :py:obj:`IsFlow`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`revise `\ () + - \- + + + .. rubric:: Members + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: revise() -> omnipy.api.types.JobT + + + + + + +.. py:class:: IsDagFlowTemplate(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobTemplate`\ [\ :py:obj:`IsTaskTemplate`\ , :py:obj:`IsDagFlowTemplate`\ , :py:obj:`IsDagFlow`\ ], :py:obj:`IsFlowTemplate`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`refine `\ (\*task_templates, update, name, iterate_over_data_files, fixed_params, param_key_map, result_key, persist_outputs, restore_outputs, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: refine(*task_templates: omnipy.api.types.TaskTemplateT, update: bool = True, name: Optional[str] = None, iterate_over_data_files: bool = False, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None, result_key: Optional[str] = None, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None, **kwargs: object) -> omnipy.api.types.JobTemplateT + + + .. py:method:: apply() -> omnipy.api.types.JobT + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + + + + +.. py:class:: IsDagFlow(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJob`\ [\ :py:obj:`IsTaskTemplate`\ , :py:obj:`IsDagFlowTemplate`\ ], :py:obj:`IsFlow`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`revise `\ () + - \- + + + .. rubric:: Members + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: revise() -> omnipy.api.types.JobT + + + + + + +.. py:class:: IsFuncFlowTemplate(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplate`\ [\ :py:obj:`IsFuncFlowTemplate`\ , :py:obj:`IsFuncFlow`\ ], :py:obj:`IsFlowTemplate`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`refine `\ (\*args, update, name, iterate_over_data_files, persist_outputs, restore_outputs, result_key, fixed_params, param_key_map, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: refine(*args: Any, update: bool = True, name: Optional[str] = None, iterate_over_data_files: bool = False, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None, result_key: Optional[str] = None, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None, **kwargs: object) -> omnipy.api.types.JobTemplateT + + + .. py:method:: apply() -> omnipy.api.types.JobT + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + + + + +.. py:class:: IsFuncFlow(*, name: Optional[str] = None) + + Bases: :py:obj:`omnipy.api.protocols.private.compute.job.IsFuncArgJob`\ [\ :py:obj:`IsFuncFlowTemplate`\ ], :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`revise `\ () + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: revise() -> omnipy.api.types.JobT + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + .. py:method:: create_job(*args: object, **kwargs: object) -> IsJob + :classmethod: + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: regenerate_unique_name() -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/public/config/index.rst b/docs/source/autoapi/omnipy/api/protocols/public/config/index.rst new file mode 100644 index 00000000..1ddf8847 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/public/config/index.rst @@ -0,0 +1,90 @@ + + +omnipy.api.protocols.public.config +================================== + +.. py:module:: omnipy.api.protocols.public.config + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsLocalRunnerConfig ` + - \- + * - :py:obj:`IsPrefectEngineConfig ` + - \- + * - :py:obj:`IsJobConfig ` + - \- + * - :py:obj:`IsRootLogConfig ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsLocalRunnerConfig + + Bases: :py:obj:`omnipy.api.protocols.private.engine.IsEngineConfig`, :py:obj:`Protocol` + + + + + + +.. py:class:: IsPrefectEngineConfig + + Bases: :py:obj:`omnipy.api.protocols.private.engine.IsEngineConfig`, :py:obj:`Protocol` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`use_cached_results ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: use_cached_results + :type: int + :value: False + + + + + + + +.. py:class:: IsJobConfig + + Bases: :py:obj:`omnipy.api.protocols.private.config.IsJobConfigBase`, :py:obj:`Protocol` + + + + + + +.. py:class:: IsRootLogConfig + + Bases: :py:obj:`Protocol` + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/public/engine/index.rst b/docs/source/autoapi/omnipy/api/protocols/public/engine/index.rst new file mode 100644 index 00000000..c674a026 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/public/engine/index.rst @@ -0,0 +1,202 @@ + + +omnipy.api.protocols.public.engine +================================== + +.. py:module:: omnipy.api.protocols.public.engine + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsTaskRunnerEngine ` + - \- + * - :py:obj:`IsLinearFlowRunnerEngine ` + - \- + * - :py:obj:`IsDagFlowRunnerEngine ` + - \- + * - :py:obj:`IsFuncFlowRunnerEngine ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsTaskRunnerEngine + + Bases: :py:obj:`omnipy.api.protocols.private.engine.IsEngine`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`apply_task_decorator `\ (task, job_callback_accept_decorator) + - \- + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` \- + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: apply_task_decorator(task: omnipy.api.protocols.public.compute.IsTask, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: get_config_cls() -> Type[IsEngineConfig] + :classmethod: + + + .. py:method:: set_config(config: IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + +.. py:class:: IsLinearFlowRunnerEngine + + Bases: :py:obj:`omnipy.api.protocols.private.engine.IsEngine`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`apply_linear_flow_decorator `\ (linear_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` \- + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: apply_linear_flow_decorator(linear_flow: omnipy.api.protocols.public.compute.IsLinearFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: get_config_cls() -> Type[IsEngineConfig] + :classmethod: + + + .. py:method:: set_config(config: IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + +.. py:class:: IsDagFlowRunnerEngine + + Bases: :py:obj:`omnipy.api.protocols.private.engine.IsEngine`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`apply_dag_flow_decorator `\ (dag_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` \- + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: apply_dag_flow_decorator(dag_flow: omnipy.api.protocols.public.compute.IsDagFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: get_config_cls() -> Type[IsEngineConfig] + :classmethod: + + + .. py:method:: set_config(config: IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + +.. py:class:: IsFuncFlowRunnerEngine + + Bases: :py:obj:`omnipy.api.protocols.private.engine.IsEngine`, :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`apply_func_flow_decorator `\ (func_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` \- + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: apply_func_flow_decorator(func_flow: omnipy.api.protocols.public.compute.IsFuncFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: get_config_cls() -> Type[IsEngineConfig] + :classmethod: + + + .. py:method:: set_config(config: IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/public/hub/index.rst b/docs/source/autoapi/omnipy/api/protocols/public/hub/index.rst new file mode 100644 index 00000000..830a519c --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/public/hub/index.rst @@ -0,0 +1,138 @@ + + +omnipy.api.protocols.public.hub +=============================== + +.. py:module:: omnipy.api.protocols.public.hub + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsRootLogObjects ` + - \- + * - :py:obj:`IsRuntimeConfig ` + - \- + * - :py:obj:`IsRuntimeObjects ` + - \- + * - :py:obj:`IsRuntime ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsRootLogObjects + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`formatter ` + - \- + * - :py:obj:`stdout_handler ` + - \- + * - :py:obj:`stderr_handler ` + - \- + * - :py:obj:`file_handler ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`set_config `\ (config) + - \- + + + .. rubric:: Members + + .. py:attribute:: formatter + :type: Optional[logging.Formatter] + + + + .. py:attribute:: stdout_handler + :type: Optional[logging.StreamHandler] + + + + .. py:attribute:: stderr_handler + :type: Optional[logging.StreamHandler] + + + + .. py:attribute:: file_handler + :type: Optional[logging.handlers.TimedRotatingFileHandler] + + + + .. py:method:: set_config(config: omnipy.api.protocols.public.config.IsRootLogConfig) -> None + + + + + + +.. py:class:: IsRuntimeConfig(job: Optional[omnipy.api.protocols.public.config.IsJobConfig] = None, engine: omnipy.api.enums.EngineChoice = EngineChoice.LOCAL, local: Optional[omnipy.api.protocols.public.config.IsLocalRunnerConfig] = None, prefect: Optional[omnipy.api.protocols.public.config.IsPrefectEngineConfig] = None, root_log: Optional[IsRootLogConfigEntryPublisher] = None, *args: Any, **kwargs: Any) + + Bases: :py:obj:`Protocol` + + + + + + +.. py:class:: IsRuntimeObjects(job_creator: Optional[omnipy.api.protocols.private.compute.job_creator.IsJobConfigHolder] = None, local: Optional[omnipy.api.protocols.private.engine.IsEngine] = None, prefect: Optional[omnipy.api.protocols.private.engine.IsEngine] = None, registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry] = None, root_log: Optional[IsRootLogObjects] = None, *args: Any, **kwargs: Any) + + Bases: :py:obj:`Protocol` + + + + + + +.. py:class:: IsRuntime(config: Optional[IsRuntimeConfig] = None, objects: Optional[IsRuntimeObjects] = None, *args: Any, **kwargs: Any) + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`reset_subscriptions `\ () + - \- + + + .. rubric:: Members + + .. py:method:: reset_subscriptions() + + + + + + + diff --git a/docs/source/autoapi/omnipy/api/protocols/public/index.rst b/docs/source/autoapi/omnipy/api/protocols/public/index.rst new file mode 100644 index 00000000..408d0140 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/protocols/public/index.rst @@ -0,0 +1,20 @@ + + +omnipy.api.protocols.public +=========================== + +.. py:module:: omnipy.api.protocols.public + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + compute/index.rst + config/index.rst + engine/index.rst + hub/index.rst + + diff --git a/docs/source/autoapi/omnipy/api/types/index.rst b/docs/source/autoapi/omnipy/api/types/index.rst new file mode 100644 index 00000000..16def168 --- /dev/null +++ b/docs/source/autoapi/omnipy/api/types/index.rst @@ -0,0 +1,55 @@ + + +omnipy.api.types +================ + +.. py:module:: omnipy.api.types + + +Overview +-------- + + + + +Attributes +---------- +.. py:data:: GeneralDecorator + + + +.. py:data:: LocaleType + :type: TypeAlias + + + +.. py:data:: JobConfigT + + + +.. py:data:: JobT + + + +.. py:data:: JobTemplateT + + + +.. py:data:: TaskTemplateT + + + +.. py:data:: TaskTemplateContraT + + + +.. py:data:: TaskTemplateCovT + + + +.. py:data:: DecoratorClassT + + + + + diff --git a/docs/source/autoapi/omnipy/compute/flow/index.rst b/docs/source/autoapi/omnipy/compute/flow/index.rst new file mode 100644 index 00000000..470b7718 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/flow/index.rst @@ -0,0 +1,517 @@ + + +omnipy.compute.flow +=================== + +.. py:module:: omnipy.compute.flow + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`FlowBase ` + - \- + * - :py:obj:`LinearFlowTemplate ` + - \- + * - :py:obj:`LinearFlow ` + - \- + * - :py:obj:`DagFlowTemplate ` + - \- + * - :py:obj:`DagFlow ` + - \- + * - :py:obj:`FuncFlowTemplate ` + - \- + * - :py:obj:`FuncFlow ` + - \- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`linear_flow_template_callable_decorator_cls `\ (cls) + - \- + * - :py:obj:`dag_flow_template_callable_decorator_cls `\ (cls) + - \- + * - :py:obj:`func_flow_template_callable_decorator_cls `\ (cls) + - \- + + + +Classes +------- + + + +.. py:class:: FlowBase + + + + + + +.. py:class:: LinearFlowTemplate(*args, **kwargs) + + Bases: :py:obj:`omnipy.compute.job.JobTemplateMixin`, :py:obj:`FlowBase`, :py:obj:`omnipy.compute.tasklist_job.TaskTemplateArgsJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`refine `\ (\*args, update, \*\*kwargs) + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: apply() -> omnipy.api.protocols.private.compute.job.IsJob + + + .. py:method:: refine(*args: Any, update: bool = True, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + +.. py:class:: LinearFlow(*args, **kwargs) + + Bases: :py:obj:`omnipy.compute.job.JobMixin`, :py:obj:`FlowBase`, :py:obj:`omnipy.compute.tasklist_job.TaskTemplateArgsJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`revise `\ () + - \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJob + :classmethod: + + + .. py:method:: revise() -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + + + + +.. py:class:: DagFlowTemplate(*args, **kwargs) + + Bases: :py:obj:`omnipy.compute.job.JobTemplateMixin`, :py:obj:`FlowBase`, :py:obj:`omnipy.compute.tasklist_job.TaskTemplateArgsJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`refine `\ (\*args, update, \*\*kwargs) + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: apply() -> omnipy.api.protocols.private.compute.job.IsJob + + + .. py:method:: refine(*args: Any, update: bool = True, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + +.. py:class:: DagFlow(*args, **kwargs) + + Bases: :py:obj:`omnipy.compute.job.JobMixin`, :py:obj:`FlowBase`, :py:obj:`omnipy.compute.tasklist_job.TaskTemplateArgsJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`revise `\ () + - \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJob + :classmethod: + + + .. py:method:: revise() -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + + + + +.. py:class:: FuncFlowTemplate(*args, **kwargs) + + Bases: :py:obj:`omnipy.compute.job.JobTemplateMixin`, :py:obj:`FlowBase`, :py:obj:`omnipy.compute.func_job.FuncArgJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`refine `\ (\*args, update, \*\*kwargs) + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: apply() -> omnipy.api.protocols.private.compute.job.IsJob + + + .. py:method:: refine(*args: Any, update: bool = True, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + +.. py:class:: FuncFlow(*args, **kwargs) + + Bases: :py:obj:`omnipy.compute.job.JobMixin`, :py:obj:`FlowBase`, :py:obj:`omnipy.compute.func_job.FuncArgJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`revise `\ () + - \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJob + :classmethod: + + + .. py:method:: revise() -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + + +Functions +--------- +.. py:function:: linear_flow_template_callable_decorator_cls(cls: Type[LinearFlowTemplate]) -> omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobTemplateCallable[omnipy.api.protocols.public.compute.IsTaskTemplate, omnipy.api.protocols.public.compute.IsLinearFlowTemplate] + + +.. py:function:: dag_flow_template_callable_decorator_cls(cls: Type[DagFlowTemplate]) -> omnipy.api.protocols.private.compute.job.IsTaskTemplateArgsJobTemplateCallable[omnipy.api.protocols.public.compute.IsTaskTemplate, omnipy.api.protocols.public.compute.IsDagFlowTemplate] + + +.. py:function:: func_flow_template_callable_decorator_cls(cls: Type[FuncFlowTemplate]) -> omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplateCallable[omnipy.api.protocols.public.compute.IsFuncFlowTemplate] + + + + + diff --git a/docs/source/autoapi/omnipy/compute/func_job/index.rst b/docs/source/autoapi/omnipy/compute/func_job/index.rst new file mode 100644 index 00000000..75a4c791 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/func_job/index.rst @@ -0,0 +1,142 @@ + + +omnipy.compute.func_job +======================= + +.. py:module:: omnipy.compute.func_job + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`PlainFuncArgJobBase ` + - \- + * - :py:obj:`FuncArgJobBase ` + - \- + + + + +Classes +------- + + + +.. py:class:: PlainFuncArgJobBase(job_func: Callable, *args: object, **kwargs: object) + + Bases: :py:obj:`omnipy.compute.job.JobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + +.. py:class:: FuncArgJobBase(job_func: Callable, *args: object, **kwargs: object) + + Bases: :py:obj:`PlainFuncArgJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/index.rst b/docs/source/autoapi/omnipy/compute/index.rst new file mode 100644 index 00000000..cd20af18 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/index.rst @@ -0,0 +1,32 @@ + + +omnipy.compute +============== + +.. py:module:: omnipy.compute + + +Subpackages +----------- +.. toctree:: + :titlesonly: + :maxdepth: 3 + + mixins/index.rst + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + flow/index.rst + func_job/index.rst + job/index.rst + job_creator/index.rst + task/index.rst + tasklist_job/index.rst + typing/index.rst + + diff --git a/docs/source/autoapi/omnipy/compute/job/index.rst b/docs/source/autoapi/omnipy/compute/job/index.rst new file mode 100644 index 00000000..0270048a --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/job/index.rst @@ -0,0 +1,190 @@ + + +omnipy.compute.job +================== + +.. py:module:: omnipy.compute.job + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JobBase ` + - \- + * - :py:obj:`JobTemplateMixin ` + - \- + * - :py:obj:`JobMixin ` + - \- + + + + +Classes +------- + + + +.. py:class:: JobBase(*args: object, **kwargs: object) + + Bases: :py:obj:`omnipy.log.mixin.LogMixin`, :py:obj:`omnipy.util.mixin.DynamicMixinAcceptor` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + +.. py:class:: JobTemplateMixin(*args, **kwargs) + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`refine `\ (\*args, update, \*\*kwargs) + - \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: apply() -> omnipy.api.protocols.private.compute.job.IsJob + + + .. py:method:: refine(*args: Any, update: bool = True, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + + + + +.. py:class:: JobMixin(*args, **kwargs) + + Bases: :py:obj:`omnipy.util.mixin.DynamicMixinAcceptor` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`revise `\ () + - \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJob + :classmethod: + + + .. py:method:: revise() -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/job_creator/index.rst b/docs/source/autoapi/omnipy/compute/job_creator/index.rst new file mode 100644 index 00000000..97f6ec1a --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/job_creator/index.rst @@ -0,0 +1,68 @@ + + +omnipy.compute.job_creator +========================== + +.. py:module:: omnipy.compute.job_creator + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JobCreator ` + - \- + * - :py:obj:`JobBaseMeta ` + - \- + + + + +Classes +------- + + + +.. py:class:: JobCreator + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`set_engine `\ (engine) + - \- + * - :py:obj:`set_config `\ (config) + - \- + + + .. rubric:: Members + + .. py:method:: set_engine(engine: omnipy.api.protocols.private.engine.IsEngine) -> None + + + .. py:method:: set_config(config: omnipy.api.protocols.public.config.IsJobConfig) -> None + + + + + + +.. py:class:: JobBaseMeta + + Bases: :py:obj:`abc.ABCMeta` + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/flow_context/index.rst b/docs/source/autoapi/omnipy/compute/mixins/flow_context/index.rst new file mode 100644 index 00000000..7d244bc4 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/flow_context/index.rst @@ -0,0 +1,35 @@ + + +omnipy.compute.mixins.flow_context +================================== + +.. py:module:: omnipy.compute.mixins.flow_context + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`FlowContextJobMixin ` + - \- + + + + +Classes +------- + + + +.. py:class:: FlowContextJobMixin + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/func_signature/index.rst b/docs/source/autoapi/omnipy/compute/mixins/func_signature/index.rst new file mode 100644 index 00000000..7a124481 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/func_signature/index.rst @@ -0,0 +1,52 @@ + + +omnipy.compute.mixins.func_signature +==================================== + +.. py:module:: omnipy.compute.mixins.func_signature + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`SignatureFuncJobBaseMixin ` + - \- + + + + +Classes +------- + + + +.. py:class:: SignatureFuncJobBaseMixin + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`get_call_args `\ (\*args, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: get_call_args(*args: object, **kwargs: object) -> Dict[str, object] + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/index.rst b/docs/source/autoapi/omnipy/compute/mixins/index.rst new file mode 100644 index 00000000..e875995e --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/index.rst @@ -0,0 +1,24 @@ + + +omnipy.compute.mixins +===================== + +.. py:module:: omnipy.compute.mixins + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + flow_context/index.rst + func_signature/index.rst + iterate/index.rst + mixin_types/index.rst + name/index.rst + params/index.rst + result_key/index.rst + serialize/index.rst + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/iterate/index.rst b/docs/source/autoapi/omnipy/compute/mixins/iterate/index.rst new file mode 100644 index 00000000..3749034d --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/iterate/index.rst @@ -0,0 +1,35 @@ + + +omnipy.compute.mixins.iterate +============================= + +.. py:module:: omnipy.compute.mixins.iterate + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IterateFuncJobBaseMixin ` + - \- + + + + +Classes +------- + + + +.. py:class:: IterateFuncJobBaseMixin(*, iterate_over_data_files: bool = False) + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/mixin_types/index.rst b/docs/source/autoapi/omnipy/compute/mixins/mixin_types/index.rst new file mode 100644 index 00000000..26b0aff5 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/mixin_types/index.rst @@ -0,0 +1,104 @@ + + +omnipy.compute.mixins.mixin_types +================================= + +.. py:module:: omnipy.compute.mixins.mixin_types + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsIterateInnerCallable ` + - \- + + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`InputT ` + - \- + * - :py:obj:`ModelInputT ` + - \- + * - :py:obj:`ReturnT ` + - \- + * - :py:obj:`ModelReturnT ` + - \- + * - :py:obj:`InputTypeT ` + - \- + * - :py:obj:`InputDatasetT ` + - \- + * - :py:obj:`ReturnDatasetT ` + - \- + + +Classes +------- + + + +.. py:class:: IsIterateInnerCallable + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`__call__ `\ (data_file, \*args, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: __call__(data_file: Union[InputT, ModelInputT], *args: object, **kwargs: object) -> Union[ReturnT, ModelReturnT] + + + + + +Attributes +---------- +.. py:data:: InputT + + + +.. py:data:: ModelInputT + + + +.. py:data:: ReturnT + + + +.. py:data:: ModelReturnT + + + +.. py:data:: InputTypeT + + + +.. py:data:: InputDatasetT + + + +.. py:data:: ReturnDatasetT + + + + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/name/index.rst b/docs/source/autoapi/omnipy/compute/mixins/name/index.rst new file mode 100644 index 00000000..d4c1d417 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/name/index.rst @@ -0,0 +1,61 @@ + + +omnipy.compute.mixins.name +========================== + +.. py:module:: omnipy.compute.mixins.name + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`NameJobBaseMixin ` + - \- + * - :py:obj:`NameJobMixin ` + - \- + + + + +Classes +------- + + + +.. py:class:: NameJobBaseMixin(*, name: Optional[str] = None) + + + + + + +.. py:class:: NameJobMixin + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`regenerate_unique_name `\ () + - \- + + + .. rubric:: Members + + .. py:method:: regenerate_unique_name() -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/params/index.rst b/docs/source/autoapi/omnipy/compute/mixins/params/index.rst new file mode 100644 index 00000000..c62989a4 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/params/index.rst @@ -0,0 +1,35 @@ + + +omnipy.compute.mixins.params +============================ + +.. py:module:: omnipy.compute.mixins.params + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`ParamsFuncJobBaseMixin ` + - \- + + + + +Classes +------- + + + +.. py:class:: ParamsFuncJobBaseMixin(*, fixed_params: Optional[Mapping[str, object]] = None, param_key_map: Optional[Mapping[str, str]] = None) + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/result_key/index.rst b/docs/source/autoapi/omnipy/compute/mixins/result_key/index.rst new file mode 100644 index 00000000..acbbed52 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/result_key/index.rst @@ -0,0 +1,35 @@ + + +omnipy.compute.mixins.result_key +================================ + +.. py:module:: omnipy.compute.mixins.result_key + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`ResultKeyFuncJobBaseMixin ` + - \- + + + + +Classes +------- + + + +.. py:class:: ResultKeyFuncJobBaseMixin(*, result_key: Optional[str] = None) + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/mixins/serialize/index.rst b/docs/source/autoapi/omnipy/compute/mixins/serialize/index.rst new file mode 100644 index 00000000..fc662a9a --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/mixins/serialize/index.rst @@ -0,0 +1,55 @@ + + +omnipy.compute.mixins.serialize +=============================== + +.. py:module:: omnipy.compute.mixins.serialize + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`SerializerFuncJobBaseMixin ` + - \- + + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`PersistOpts ` + - \- + * - :py:obj:`RestoreOpts ` + - \- + + +Classes +------- + + + +.. py:class:: SerializerFuncJobBaseMixin(*, persist_outputs: Optional[omnipy.api.enums.PersistOutputsOptions] = None, restore_outputs: Optional[omnipy.api.enums.RestoreOutputsOptions] = None) + + + + + +Attributes +---------- +.. py:data:: PersistOpts + + + +.. py:data:: RestoreOpts + + + + + diff --git a/docs/source/autoapi/omnipy/compute/task/index.rst b/docs/source/autoapi/omnipy/compute/task/index.rst new file mode 100644 index 00000000..f70646f5 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/task/index.rst @@ -0,0 +1,201 @@ + + +omnipy.compute.task +=================== + +.. py:module:: omnipy.compute.task + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`TaskBase ` + - \- + * - :py:obj:`TaskTemplate ` + - \- + * - :py:obj:`Task ` + - \- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`task_template_callable_decorator_cls `\ (cls) + - \- + + + +Classes +------- + + + +.. py:class:: TaskBase + + + + + + +.. py:class:: TaskTemplate(*args, **kwargs) + + Bases: :py:obj:`omnipy.compute.job.JobTemplateMixin`, :py:obj:`TaskBase`, :py:obj:`omnipy.compute.func_job.FuncArgJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job_template `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`run `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`apply `\ () + - \- + * - :py:obj:`refine `\ (\*args, update, \*\*kwargs) + - \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job_template(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + :classmethod: + + + .. py:method:: run(*args: object, **kwargs: object) -> object + + + .. py:method:: apply() -> omnipy.api.protocols.private.compute.job.IsJob + + + .. py:method:: refine(*args: Any, update: bool = True, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + +.. py:class:: Task(*args, **kwargs) + + Bases: :py:obj:`omnipy.compute.job.JobMixin`, :py:obj:`TaskBase`, :py:obj:`omnipy.compute.func_job.FuncArgJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`create_job `\ (\*args, \*\*kwargs) + - :summarylabel:`class` \- + * - :py:obj:`revise `\ () + - \- + * - :py:obj:`__call__ `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: create_job(*args: object, **kwargs: object) -> omnipy.api.protocols.private.compute.job.IsJob + :classmethod: + + + .. py:method:: revise() -> omnipy.api.protocols.private.compute.job.IsJobTemplate + + + .. py:method:: __call__(*args: object, **kwargs: object) -> object + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + + +Functions +--------- +.. py:function:: task_template_callable_decorator_cls(cls: Type[TaskTemplate]) -> omnipy.api.protocols.private.compute.job.IsFuncArgJobTemplateCallable[omnipy.api.protocols.public.compute.IsTaskTemplate] + + + + + diff --git a/docs/source/autoapi/omnipy/compute/tasklist_job/index.rst b/docs/source/autoapi/omnipy/compute/tasklist_job/index.rst new file mode 100644 index 00000000..d25cfe6e --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/tasklist_job/index.rst @@ -0,0 +1,84 @@ + + +omnipy.compute.tasklist_job +=========================== + +.. py:module:: omnipy.compute.tasklist_job + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`TaskTemplateArgsJobBase ` + - \- + + + + +Classes +------- + + + +.. py:class:: TaskTemplateArgsJobBase(job_func: Callable, *task_templates: omnipy.api.protocols.public.compute.IsTaskTemplate, **kwargs: object) + + Bases: :py:obj:`omnipy.compute.func_job.FuncArgJobBase` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`has_coroutine_func `\ () + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: has_coroutine_func() -> bool + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + + diff --git a/docs/source/autoapi/omnipy/compute/typing/index.rst b/docs/source/autoapi/omnipy/compute/typing/index.rst new file mode 100644 index 00000000..0a7cbda4 --- /dev/null +++ b/docs/source/autoapi/omnipy/compute/typing/index.rst @@ -0,0 +1,46 @@ + + +omnipy.compute.typing +===================== + +.. py:module:: omnipy.compute.typing + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`mypy_fix_task_template `\ (task_template) + - \- + * - :py:obj:`mypy_fix_linear_flow_template `\ (linear_flow_template) + - \- + * - :py:obj:`mypy_fix_dag_flow_template `\ (dag_flow_template) + - \- + * - :py:obj:`mypy_fix_func_flow_template `\ (func_flow_template) + - \- + + + + +Functions +--------- +.. py:function:: mypy_fix_task_template(task_template: object) -> omnipy.api.protocols.public.compute.IsTaskTemplate + + +.. py:function:: mypy_fix_linear_flow_template(linear_flow_template: object) -> omnipy.api.protocols.public.compute.IsLinearFlowTemplate + + +.. py:function:: mypy_fix_dag_flow_template(dag_flow_template: object) -> omnipy.api.protocols.public.compute.IsDagFlowTemplate + + +.. py:function:: mypy_fix_func_flow_template(func_flow_template: object) -> omnipy.api.protocols.public.compute.IsFuncFlowTemplate + + + + + diff --git a/docs/source/autoapi/omnipy/config/engine/index.rst b/docs/source/autoapi/omnipy/config/engine/index.rst new file mode 100644 index 00000000..e86caa76 --- /dev/null +++ b/docs/source/autoapi/omnipy/config/engine/index.rst @@ -0,0 +1,77 @@ + + +omnipy.config.engine +==================== + +.. py:module:: omnipy.config.engine + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`EngineConfig ` + - \- + * - :py:obj:`LocalRunnerConfig ` + - \- + * - :py:obj:`PrefectEngineConfig ` + - \- + + + + +Classes +------- + + + +.. py:class:: EngineConfig + + + + + + +.. py:class:: LocalRunnerConfig + + Bases: :py:obj:`EngineConfig` + + + + + + +.. py:class:: PrefectEngineConfig + + Bases: :py:obj:`EngineConfig` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`use_cached_results ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: use_cached_results + :type: int + :value: False + + + + + + + + diff --git a/docs/source/autoapi/omnipy/config/index.rst b/docs/source/autoapi/omnipy/config/index.rst new file mode 100644 index 00000000..14b0c70f --- /dev/null +++ b/docs/source/autoapi/omnipy/config/index.rst @@ -0,0 +1,19 @@ + + +omnipy.config +============= + +.. py:module:: omnipy.config + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + engine/index.rst + job/index.rst + root_log/index.rst + + diff --git a/docs/source/autoapi/omnipy/config/job/index.rst b/docs/source/autoapi/omnipy/config/job/index.rst new file mode 100644 index 00000000..d912ebc9 --- /dev/null +++ b/docs/source/autoapi/omnipy/config/job/index.rst @@ -0,0 +1,61 @@ + + +omnipy.config.job +================= + +.. py:module:: omnipy.config.job + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JobConfig ` + - \- + + + + +Classes +------- + + + +.. py:class:: JobConfig + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`persist_outputs ` + - \- + * - :py:obj:`restore_outputs ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: persist_outputs + :type: omnipy.api.enums.ConfigPersistOutputsOptions + + + + .. py:attribute:: restore_outputs + :type: omnipy.api.enums.ConfigRestoreOutputsOptions + + + + + + + + diff --git a/docs/source/autoapi/omnipy/config/root_log/index.rst b/docs/source/autoapi/omnipy/config/root_log/index.rst new file mode 100644 index 00000000..ec9a8628 --- /dev/null +++ b/docs/source/autoapi/omnipy/config/root_log/index.rst @@ -0,0 +1,107 @@ + + +omnipy.config.root_log +====================== + +.. py:module:: omnipy.config.root_log + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`RootLogConfig ` + - \- + + + + +Classes +------- + + + +.. py:class:: RootLogConfig + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`log_format_str ` + - \- + * - :py:obj:`locale ` + - \- + * - :py:obj:`log_to_stdout ` + - \- + * - :py:obj:`log_to_stderr ` + - \- + * - :py:obj:`log_to_file ` + - \- + * - :py:obj:`stdout_log_min_level ` + - \- + * - :py:obj:`stderr_log_min_level ` + - \- + * - :py:obj:`file_log_min_level ` + - \- + + + + .. rubric:: Members + + .. py:attribute:: log_format_str + :type: str + :value: '{engine} {asctime} - {levelname}: {message} [{name}]' + + + + .. py:attribute:: locale + :type: omnipy.api.types.LocaleType + + + + .. py:attribute:: log_to_stdout + :type: bool + :value: True + + + + .. py:attribute:: log_to_stderr + :type: bool + :value: True + + + + .. py:attribute:: log_to_file + :type: bool + :value: True + + + + .. py:attribute:: stdout_log_min_level + :type: int + + + + .. py:attribute:: stderr_log_min_level + :type: int + + + + .. py:attribute:: file_log_min_level + :type: int + + + + + + + + diff --git a/docs/source/autoapi/omnipy/engine/base/index.rst b/docs/source/autoapi/omnipy/engine/base/index.rst new file mode 100644 index 00000000..0c77440d --- /dev/null +++ b/docs/source/autoapi/omnipy/engine/base/index.rst @@ -0,0 +1,73 @@ + + +omnipy.engine.base +================== + +.. py:module:: omnipy.engine.base + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`Engine ` + - Base class for engine implementations + + + + +Classes +------- + + + +.. py:class:: Engine + + Bases: :py:obj:`abc.ABC` + + Base class for engine implementations + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` Specification of config class mapped to an Engine subclass. Must be implemented by all + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: get_config_cls() -> Type[omnipy.api.protocols.private.engine.IsEngineConfig] + :classmethod: + :abstractmethod: + + Specification of config class mapped to an Engine subclass. Must be implemented by all + subclasses of Engine. If no configuration is needed, then the EngineConfig class should be + returned. + :return: Class implementing the IsEngineConfig protocol + + + .. py:method:: set_config(config: omnipy.api.protocols.private.engine.IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/engine/index.rst b/docs/source/autoapi/omnipy/engine/index.rst new file mode 100644 index 00000000..09fa2408 --- /dev/null +++ b/docs/source/autoapi/omnipy/engine/index.rst @@ -0,0 +1,19 @@ + + +omnipy.engine +============= + +.. py:module:: omnipy.engine + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + base/index.rst + job_runner/index.rst + local/index.rst + + diff --git a/docs/source/autoapi/omnipy/engine/job_runner/index.rst b/docs/source/autoapi/omnipy/engine/job_runner/index.rst new file mode 100644 index 00000000..38877ca7 --- /dev/null +++ b/docs/source/autoapi/omnipy/engine/job_runner/index.rst @@ -0,0 +1,293 @@ + + +omnipy.engine.job_runner +======================== + +.. py:module:: omnipy.engine.job_runner + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JobRunnerEngine ` + - Base class for job runner engine implementations + * - :py:obj:`TaskRunnerEngine ` + - Base class for task runner engine implementations + * - :py:obj:`LinearFlowRunnerEngine ` + - Base class for linear flow runner engine implementations + * - :py:obj:`DagFlowRunnerEngine ` + - Base class for DAG flow runner engine implementations + * - :py:obj:`FuncFlowRunnerEngine ` + - Base class for function flow runner engine implementations + + + + +Classes +------- + + + +.. py:class:: JobRunnerEngine + + Bases: :py:obj:`omnipy.engine.base.Engine`, :py:obj:`abc.ABC` + + Base class for job runner engine implementations + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` Specification of config class mapped to an Engine subclass. Must be implemented by all + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: get_config_cls() -> Type[omnipy.api.protocols.private.engine.IsEngineConfig] + :classmethod: + :abstractmethod: + + Specification of config class mapped to an Engine subclass. Must be implemented by all + subclasses of Engine. If no configuration is needed, then the EngineConfig class should be + returned. + :return: Class implementing the IsEngineConfig protocol + + + .. py:method:: set_config(config: omnipy.api.protocols.private.engine.IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + +.. py:class:: TaskRunnerEngine + + Bases: :py:obj:`JobRunnerEngine` + + Base class for task runner engine implementations + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`apply_task_decorator `\ (task, job_callback_accept_decorator) + - \- + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` Specification of config class mapped to an Engine subclass. Must be implemented by all + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: apply_task_decorator(task: omnipy.api.protocols.public.compute.IsTask, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: get_config_cls() -> Type[omnipy.api.protocols.private.engine.IsEngineConfig] + :classmethod: + :abstractmethod: + + Specification of config class mapped to an Engine subclass. Must be implemented by all + subclasses of Engine. If no configuration is needed, then the EngineConfig class should be + returned. + :return: Class implementing the IsEngineConfig protocol + + + .. py:method:: set_config(config: omnipy.api.protocols.private.engine.IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + +.. py:class:: LinearFlowRunnerEngine + + Bases: :py:obj:`JobRunnerEngine` + + Base class for linear flow runner engine implementations + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`apply_linear_flow_decorator `\ (linear_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`default_linear_flow_run_decorator `\ (linear_flow) + - :summarylabel:`static` \- + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` Specification of config class mapped to an Engine subclass. Must be implemented by all + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: apply_linear_flow_decorator(linear_flow: omnipy.api.protocols.public.compute.IsLinearFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: default_linear_flow_run_decorator(linear_flow: omnipy.api.protocols.public.compute.IsLinearFlow) -> Any + :staticmethod: + + + .. py:method:: get_config_cls() -> Type[omnipy.api.protocols.private.engine.IsEngineConfig] + :classmethod: + :abstractmethod: + + Specification of config class mapped to an Engine subclass. Must be implemented by all + subclasses of Engine. If no configuration is needed, then the EngineConfig class should be + returned. + :return: Class implementing the IsEngineConfig protocol + + + .. py:method:: set_config(config: omnipy.api.protocols.private.engine.IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + +.. py:class:: DagFlowRunnerEngine + + Bases: :py:obj:`JobRunnerEngine` + + Base class for DAG flow runner engine implementations + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`apply_dag_flow_decorator `\ (dag_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`default_dag_flow_run_decorator `\ (dag_flow) + - :summarylabel:`static` \- + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` Specification of config class mapped to an Engine subclass. Must be implemented by all + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: apply_dag_flow_decorator(dag_flow: omnipy.api.protocols.public.compute.IsDagFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: default_dag_flow_run_decorator(dag_flow: omnipy.api.protocols.public.compute.IsDagFlow) -> Any + :staticmethod: + + + .. py:method:: get_config_cls() -> Type[omnipy.api.protocols.private.engine.IsEngineConfig] + :classmethod: + :abstractmethod: + + Specification of config class mapped to an Engine subclass. Must be implemented by all + subclasses of Engine. If no configuration is needed, then the EngineConfig class should be + returned. + :return: Class implementing the IsEngineConfig protocol + + + .. py:method:: set_config(config: omnipy.api.protocols.private.engine.IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + +.. py:class:: FuncFlowRunnerEngine + + Bases: :py:obj:`JobRunnerEngine` + + Base class for function flow runner engine implementations + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`apply_func_flow_decorator `\ (func_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` Specification of config class mapped to an Engine subclass. Must be implemented by all + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + + + .. rubric:: Members + + .. py:method:: apply_func_flow_decorator(func_flow: omnipy.api.protocols.public.compute.IsFuncFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: get_config_cls() -> Type[omnipy.api.protocols.private.engine.IsEngineConfig] + :classmethod: + :abstractmethod: + + Specification of config class mapped to an Engine subclass. Must be implemented by all + subclasses of Engine. If no configuration is needed, then the EngineConfig class should be + returned. + :return: Class implementing the IsEngineConfig protocol + + + .. py:method:: set_config(config: omnipy.api.protocols.private.engine.IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/engine/local/index.rst b/docs/source/autoapi/omnipy/engine/local/index.rst new file mode 100644 index 00000000..6f1db069 --- /dev/null +++ b/docs/source/autoapi/omnipy/engine/local/index.rst @@ -0,0 +1,104 @@ + + +omnipy.engine.local +=================== + +.. py:module:: omnipy.engine.local + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`LocalRunner ` + - Local job runner + + + + +Classes +------- + + + +.. py:class:: LocalRunner + + Bases: :py:obj:`omnipy.engine.job_runner.TaskRunnerEngine`, :py:obj:`omnipy.engine.job_runner.LinearFlowRunnerEngine`, :py:obj:`omnipy.engine.job_runner.DagFlowRunnerEngine`, :py:obj:`omnipy.engine.job_runner.FuncFlowRunnerEngine` + + Local job runner + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` Specification of config class mapped to an Engine subclass. Must be implemented by all + * - :py:obj:`apply_task_decorator `\ (task, job_callback_accept_decorator) + - \- + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + * - :py:obj:`apply_linear_flow_decorator `\ (linear_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`default_linear_flow_run_decorator `\ (linear_flow) + - :summarylabel:`static` \- + * - :py:obj:`apply_dag_flow_decorator `\ (dag_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`default_dag_flow_run_decorator `\ (dag_flow) + - :summarylabel:`static` \- + * - :py:obj:`apply_func_flow_decorator `\ (func_flow, job_callback_accept_decorator) + - \- + + + .. rubric:: Members + + .. py:method:: get_config_cls() -> Type[omnipy.api.protocols.public.config.IsLocalRunnerConfig] + :classmethod: + + Specification of config class mapped to an Engine subclass. Must be implemented by all + subclasses of Engine. If no configuration is needed, then the EngineConfig class should be + returned. + :return: Class implementing the IsEngineConfig protocol + + + .. py:method:: apply_task_decorator(task: omnipy.api.protocols.public.compute.IsTask, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: set_config(config: omnipy.api.protocols.private.engine.IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + .. py:method:: apply_linear_flow_decorator(linear_flow: omnipy.api.protocols.public.compute.IsLinearFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: default_linear_flow_run_decorator(linear_flow: omnipy.api.protocols.public.compute.IsLinearFlow) -> Any + :staticmethod: + + + .. py:method:: apply_dag_flow_decorator(dag_flow: omnipy.api.protocols.public.compute.IsDagFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: default_dag_flow_run_decorator(dag_flow: omnipy.api.protocols.public.compute.IsDagFlow) -> Any + :staticmethod: + + + .. py:method:: apply_func_flow_decorator(func_flow: omnipy.api.protocols.public.compute.IsFuncFlow, job_callback_accept_decorator: Callable) -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/hub/entry/index.rst b/docs/source/autoapi/omnipy/hub/entry/index.rst new file mode 100644 index 00000000..38a1b3b4 --- /dev/null +++ b/docs/source/autoapi/omnipy/hub/entry/index.rst @@ -0,0 +1,59 @@ + + +omnipy.hub.entry +================ + +.. py:module:: omnipy.hub.entry + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`RuntimeEntryPublisher ` + - \- + + + + +Classes +------- + + + +.. py:class:: RuntimeEntryPublisher + + Bases: :py:obj:`omnipy.util.publisher.DataPublisher` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`subscribe `\ (config_item, callback_fun) + - \- + * - :py:obj:`unsubscribe_all `\ () + - \- + + + .. rubric:: Members + + .. py:method:: subscribe(config_item: str, callback_fun: Callable[[Any], None]) + + + .. py:method:: unsubscribe_all() -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/hub/index.rst b/docs/source/autoapi/omnipy/hub/index.rst new file mode 100644 index 00000000..e0b731f7 --- /dev/null +++ b/docs/source/autoapi/omnipy/hub/index.rst @@ -0,0 +1,19 @@ + + +omnipy.hub +========== + +.. py:module:: omnipy.hub + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + entry/index.rst + root_log/index.rst + runtime/index.rst + + diff --git a/docs/source/autoapi/omnipy/hub/root_log/index.rst b/docs/source/autoapi/omnipy/hub/root_log/index.rst new file mode 100644 index 00000000..040b0e15 --- /dev/null +++ b/docs/source/autoapi/omnipy/hub/root_log/index.rst @@ -0,0 +1,185 @@ + + +omnipy.hub.root_log +=================== + +.. py:module:: omnipy.hub.root_log + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`RootLogConfigEntryPublisher ` + - \- + * - :py:obj:`RootLogObjects ` + - \- + + + + +Classes +------- + + + +.. py:class:: RootLogConfigEntryPublisher + + Bases: :py:obj:`omnipy.config.root_log.RootLogConfig`, :py:obj:`omnipy.hub.entry.RuntimeEntryPublisher` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`log_format_str ` + - \- + * - :py:obj:`locale ` + - \- + * - :py:obj:`log_to_stdout ` + - \- + * - :py:obj:`log_to_stderr ` + - \- + * - :py:obj:`log_to_file ` + - \- + * - :py:obj:`stdout_log_min_level ` + - \- + * - :py:obj:`stderr_log_min_level ` + - \- + * - :py:obj:`file_log_min_level ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`subscribe `\ (config_item, callback_fun) + - \- + * - :py:obj:`unsubscribe_all `\ () + - \- + + + .. rubric:: Members + + .. py:attribute:: log_format_str + :type: str + :value: '{engine} {asctime} - {levelname}: {message} [{name}]' + + + + .. py:attribute:: locale + :type: omnipy.api.types.LocaleType + + + + .. py:attribute:: log_to_stdout + :type: bool + :value: True + + + + .. py:attribute:: log_to_stderr + :type: bool + :value: True + + + + .. py:attribute:: log_to_file + :type: bool + :value: True + + + + .. py:attribute:: stdout_log_min_level + :type: int + + + + .. py:attribute:: stderr_log_min_level + :type: int + + + + .. py:attribute:: file_log_min_level + :type: int + + + + .. py:method:: subscribe(config_item: str, callback_fun: Callable[[Any], None]) + + + .. py:method:: unsubscribe_all() -> None + + + + + + +.. py:class:: RootLogObjects + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`formatter ` + - \- + * - :py:obj:`stdout_handler ` + - \- + * - :py:obj:`stderr_handler ` + - \- + * - :py:obj:`file_handler ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`set_config `\ (config) + - \- + + + .. rubric:: Members + + .. py:attribute:: formatter + :type: Optional[logging.Formatter] + + + + .. py:attribute:: stdout_handler + :type: Optional[logging.StreamHandler] + + + + .. py:attribute:: stderr_handler + :type: Optional[logging.StreamHandler] + + + + .. py:attribute:: file_handler + :type: Optional[logging.handlers.TimedRotatingFileHandler] + + + + .. py:method:: set_config(config: omnipy.api.protocols.public.config.IsRootLogConfig) + + + + + + + diff --git a/docs/source/autoapi/omnipy/hub/runtime/index.rst b/docs/source/autoapi/omnipy/hub/runtime/index.rst new file mode 100644 index 00000000..8527d6cf --- /dev/null +++ b/docs/source/autoapi/omnipy/hub/runtime/index.rst @@ -0,0 +1,143 @@ + + +omnipy.hub.runtime +================== + +.. py:module:: omnipy.hub.runtime + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`RuntimeConfig ` + - \- + * - :py:obj:`RuntimeObjects ` + - \- + * - :py:obj:`Runtime ` + - \- + + + + +Classes +------- + + + +.. py:class:: RuntimeConfig + + Bases: :py:obj:`omnipy.hub.entry.RuntimeEntryPublisher` + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`engine ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`subscribe `\ (config_item, callback_fun) + - \- + * - :py:obj:`unsubscribe_all `\ () + - \- + + + .. rubric:: Members + + .. py:attribute:: engine + :type: omnipy.api.enums.EngineChoice + + + + .. py:method:: subscribe(config_item: str, callback_fun: Callable[[Any], None]) + + + .. py:method:: unsubscribe_all() -> None + + + + + + +.. py:class:: RuntimeObjects + + Bases: :py:obj:`omnipy.hub.entry.RuntimeEntryPublisher` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`subscribe `\ (config_item, callback_fun) + - \- + * - :py:obj:`unsubscribe_all `\ () + - \- + + + .. rubric:: Members + + .. py:method:: subscribe(config_item: str, callback_fun: Callable[[Any], None]) + + + .. py:method:: unsubscribe_all() -> None + + + + + + +.. py:class:: Runtime + + Bases: :py:obj:`omnipy.hub.entry.DataPublisher` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`reset_subscriptions `\ () + - \- + * - :py:obj:`subscribe `\ (config_item, callback_fun) + - \- + * - :py:obj:`unsubscribe_all `\ () + - \- + + + .. rubric:: Members + + .. py:method:: reset_subscriptions() + + + .. py:method:: subscribe(config_item: str, callback_fun: Callable[[Any], None]) + + + .. py:method:: unsubscribe_all() -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/index.rst b/docs/source/autoapi/omnipy/index.rst new file mode 100644 index 00000000..4de8e759 --- /dev/null +++ b/docs/source/autoapi/omnipy/index.rst @@ -0,0 +1,49 @@ + + +omnipy +====== + +.. py:module:: omnipy + + +Subpackages +----------- +.. toctree:: + :titlesonly: + :maxdepth: 3 + + api/index.rst + compute/index.rst + config/index.rst + data/index.rst + engine/index.rst + hub/index.rst + log/index.rst + modules/index.rst + util/index.rst + + +Overview +-------- + + + + +Attributes +---------- +.. py:data:: __version__ + :value: '0.10.4' + + + +.. py:data:: ROOT_DIR + + + +.. py:data:: runtime + :type: Optional[Runtime] + + + + + diff --git a/docs/source/autoapi/omnipy/log/constants/index.rst b/docs/source/autoapi/omnipy/log/constants/index.rst new file mode 100644 index 00000000..29c869f8 --- /dev/null +++ b/docs/source/autoapi/omnipy/log/constants/index.rst @@ -0,0 +1,24 @@ + + +omnipy.log.constants +==================== + +.. py:module:: omnipy.log.constants + + +Overview +-------- + + + + +Attributes +---------- +.. py:data:: OMNIPY_LOG_FORMAT_STR + :type: str + :value: '%(levelname)s - %(message)s (%(name)s)' + + + + + diff --git a/docs/source/autoapi/omnipy/log/index.rst b/docs/source/autoapi/omnipy/log/index.rst new file mode 100644 index 00000000..22bcb371 --- /dev/null +++ b/docs/source/autoapi/omnipy/log/index.rst @@ -0,0 +1,19 @@ + + +omnipy.log +========== + +.. py:module:: omnipy.log + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + constants/index.rst + mixin/index.rst + registry/index.rst + + diff --git a/docs/source/autoapi/omnipy/log/mixin/index.rst b/docs/source/autoapi/omnipy/log/mixin/index.rst new file mode 100644 index 00000000..b01da98c --- /dev/null +++ b/docs/source/autoapi/omnipy/log/mixin/index.rst @@ -0,0 +1,52 @@ + + +omnipy.log.mixin +================ + +.. py:module:: omnipy.log.mixin + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`LogMixin ` + - \- + + + + +Classes +------- + + + +.. py:class:: LogMixin + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + + + .. rubric:: Members + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + + + + + diff --git a/docs/source/autoapi/omnipy/log/registry/index.rst b/docs/source/autoapi/omnipy/log/registry/index.rst new file mode 100644 index 00000000..a43d1e21 --- /dev/null +++ b/docs/source/autoapi/omnipy/log/registry/index.rst @@ -0,0 +1,74 @@ + + +omnipy.log.registry +=================== + +.. py:module:: omnipy.log.registry + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`RunStateRegistry ` + - \- + + + + +Classes +------- + + + +.. py:class:: RunStateRegistry + + Bases: :py:obj:`omnipy.log.mixin.LogMixin` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`get_job_state `\ (job) + - \- + * - :py:obj:`get_job_state_datetime `\ (job, state) + - \- + * - :py:obj:`all_jobs `\ (state) + - \- + * - :py:obj:`set_job_state `\ (job, state) + - \- + * - :py:obj:`log `\ (log_msg, level, datetime_obj) + - \- + + + .. rubric:: Members + + .. py:method:: get_job_state(job: omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob) -> omnipy.api.enums.RunState + + + .. py:method:: get_job_state_datetime(job: omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob, state: omnipy.api.enums.RunState) -> datetime.datetime + + + .. py:method:: all_jobs(state: Optional[omnipy.api.enums.RunState] = None) -> Tuple[omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob, Ellipsis] + + + .. py:method:: set_job_state(job: omnipy.api.protocols.private.compute.mixins.IsUniquelyNamedJob, state: omnipy.api.enums.RunState) -> None + + + .. py:method:: log(log_msg: str, level: int = INFO, datetime_obj: Optional[datetime.datetime] = None) + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/fairtracks/create_filter/index.rst b/docs/source/autoapi/omnipy/modules/fairtracks/create_filter/index.rst new file mode 100644 index 00000000..ad0930c5 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/fairtracks/create_filter/index.rst @@ -0,0 +1,153 @@ + + +omnipy.modules.fairtracks.create_filter +======================================= + +.. py:module:: omnipy.modules.fairtracks.create_filter + + +Overview +-------- + + + + +Attributes +---------- +.. py:data:: download_all_projects + :value: False + + + +.. py:data:: download_all_cases + :value: False + + + +.. py:data:: number_of_projects + :value: 2 + + + +.. py:data:: number_of_cases + :value: 2 + + + +.. py:data:: number_of_files + :value: 2 + + + +.. py:data:: projects_endpt + :value: 'https://api.gdc.cancer.gov/projects' + + + +.. py:data:: cases_endpt + :value: 'https://api.gdc.cancer.gov/cases' + + + +.. py:data:: annotations_endpt + :value: 'https://api.gdc.cancer.gov/annotations' + + + +.. py:data:: params + + + +.. py:data:: response + + + +.. py:data:: buckets + + + +.. py:data:: size_max + + + +.. py:data:: size + + + +.. py:data:: fields + :value: ['summary.case_count', 'summary.file_count'] + + + +.. py:data:: fields + + + +.. py:data:: filters + + + +.. py:data:: params + + + +.. py:data:: response + + + +.. py:data:: projects_list + + + +.. py:data:: fields + :value: ['files.file_id', 'summary.file_count', 'annotation'] + + + +.. py:data:: fields + + + +.. py:data:: size + + + +.. py:data:: fields + :value: ['annotation_id'] + + + +.. py:data:: filters + + + +.. py:data:: proj_id_list + :value: [] + + + +.. py:data:: case_id_list + :value: [] + + + +.. py:data:: file_id_list + :value: [] + + + +.. py:data:: ant_id_list + :value: [] + + + +.. py:data:: id_dict + + + +.. py:data:: filters + + + + + diff --git a/docs/source/autoapi/omnipy/modules/fairtracks/functions/index.rst b/docs/source/autoapi/omnipy/modules/fairtracks/functions/index.rst new file mode 100644 index 00000000..a9753b72 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/fairtracks/functions/index.rst @@ -0,0 +1,64 @@ + + +omnipy.modules.fairtracks.functions +=================================== + +.. py:module:: omnipy.modules.fairtracks.functions + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`encode_api `\ (endpoint, id, limit, format, frame) + - \- + * - :py:obj:`gdc_api `\ (object_type, starting_point, size) + - \- + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`ENCODE_HEADERS ` + - \- + * - :py:obj:`ENCODE_BASE_URL ` + - \- + * - :py:obj:`GDC_BASE_URL ` + - \- + + + +Functions +--------- +.. py:function:: encode_api(endpoint='experiments', id=None, limit=None, format='json', frame='object') + + +.. py:function:: gdc_api(object_type='projects', starting_point=None, size=None) + + + +Attributes +---------- +.. py:data:: ENCODE_HEADERS + + + +.. py:data:: ENCODE_BASE_URL + :value: 'https://www.encodeproject.org/' + + + +.. py:data:: GDC_BASE_URL + :value: 'https://api.gdc.cancer.gov/' + + + + + diff --git a/docs/source/autoapi/omnipy/modules/fairtracks/get_from_filter/index.rst b/docs/source/autoapi/omnipy/modules/fairtracks/get_from_filter/index.rst new file mode 100644 index 00000000..4bd215ae --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/fairtracks/get_from_filter/index.rst @@ -0,0 +1,22 @@ + + +omnipy.modules.fairtracks.get_from_filter +========================================= + +.. py:module:: omnipy.modules.fairtracks.get_from_filter + + +Overview +-------- + + + + +Attributes +---------- +.. py:data:: endpt + + + + + diff --git a/docs/source/autoapi/omnipy/modules/fairtracks/index.rst b/docs/source/autoapi/omnipy/modules/fairtracks/index.rst new file mode 100644 index 00000000..9ae60915 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/fairtracks/index.rst @@ -0,0 +1,20 @@ + + +omnipy.modules.fairtracks +========================= + +.. py:module:: omnipy.modules.fairtracks + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + create_filter/index.rst + functions/index.rst + get_from_filter/index.rst + tasks/index.rst + + diff --git a/docs/source/autoapi/omnipy/modules/fairtracks/tasks/index.rst b/docs/source/autoapi/omnipy/modules/fairtracks/tasks/index.rst new file mode 100644 index 00000000..124ddefd --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/fairtracks/tasks/index.rst @@ -0,0 +1,31 @@ + + +omnipy.modules.fairtracks.tasks +=============================== + +.. py:module:: omnipy.modules.fairtracks.tasks + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`import_dataset_from_encode `\ (endpoints, max_data_item_count) + - \- + + + + +Functions +--------- +.. py:function:: import_dataset_from_encode(endpoints: Iterable[constr(min_length=1)], max_data_item_count: pydantic.PositiveInt) -> omnipy.modules.json.datasets.JsonDataset + + + + + diff --git a/docs/source/autoapi/omnipy/modules/general/index.rst b/docs/source/autoapi/omnipy/modules/general/index.rst new file mode 100644 index 00000000..52b17448 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/general/index.rst @@ -0,0 +1,18 @@ + + +omnipy.modules.general +====================== + +.. py:module:: omnipy.modules.general + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + models/index.rst + tasks/index.rst + + diff --git a/docs/source/autoapi/omnipy/modules/general/models/index.rst b/docs/source/autoapi/omnipy/modules/general/models/index.rst new file mode 100644 index 00000000..aeba4e66 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/general/models/index.rst @@ -0,0 +1,37 @@ + + +omnipy.modules.general.models +============================= + +.. py:module:: omnipy.modules.general.models + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`NotIteratorExceptStrings ` + - \- + + + + +Classes +------- + + + +.. py:class:: NotIteratorExceptStrings + + Bases: :py:obj:`omnipy.data.model.Model`\ [\ :py:obj:`object`\ ] + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/general/tasks/index.rst b/docs/source/autoapi/omnipy/modules/general/tasks/index.rst new file mode 100644 index 00000000..94c72cf0 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/general/tasks/index.rst @@ -0,0 +1,55 @@ + + +omnipy.modules.general.tasks +============================ + +.. py:module:: omnipy.modules.general.tasks + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`cast_dataset `\ (dataset, cast_model) + - \- + * - :py:obj:`split_dataset `\ (dataset, datafile_names_for_b) + - \- + * - :py:obj:`import_directory `\ (directory, exclude_prefixes, include_suffixes, model) + - \- + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`ModelT ` + - \- + + + +Functions +--------- +.. py:function:: cast_dataset(dataset: omnipy.data.dataset.Dataset, cast_model: Callable[[], ModelT]) -> ModelT + + +.. py:function:: split_dataset(dataset: omnipy.data.dataset.Dataset[omnipy.data.model.Model[object]], datafile_names_for_b: List[str]) -> Tuple[omnipy.data.dataset.Dataset[omnipy.data.model.Model[object]], omnipy.data.dataset.Dataset[omnipy.data.model.Model[object]]] + + +.. py:function:: import_directory(directory: str, exclude_prefixes: Tuple[str, Ellipsis] = ('.', '_'), include_suffixes: Tuple[str, Ellipsis] = (), model: Type[omnipy.data.model.Model] = Model[str]) -> omnipy.data.dataset.Dataset[omnipy.data.model.Model] + + + +Attributes +---------- +.. py:data:: ModelT + + + + + diff --git a/docs/source/autoapi/omnipy/modules/index.rst b/docs/source/autoapi/omnipy/modules/index.rst new file mode 100644 index 00000000..4ba5dd22 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/index.rst @@ -0,0 +1,23 @@ + + +omnipy.modules +============== + +.. py:module:: omnipy.modules + + +Subpackages +----------- +.. toctree:: + :titlesonly: + :maxdepth: 3 + + fairtracks/index.rst + general/index.rst + json/index.rst + pandas/index.rst + prefect/index.rst + raw/index.rst + tables/index.rst + + diff --git a/docs/source/autoapi/omnipy/modules/json/datasets/index.rst b/docs/source/autoapi/omnipy/modules/json/datasets/index.rst new file mode 100644 index 00000000..525c2735 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/json/datasets/index.rst @@ -0,0 +1,174 @@ + + +omnipy.modules.json.datasets +============================ + +.. py:module:: omnipy.modules.json.datasets + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JsonBaseDataset ` + - \- + * - :py:obj:`JsonDataset ` + - \- + + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JsonModelT ` + - \- + * - :py:obj:`JsonCustomDataset ` + - \- + * - :py:obj:`JsonListOfScalarsDatabase ` + - \- + * - :py:obj:`JsonListOfAnyDataset ` + - \- + * - :py:obj:`JsonListOfDictsOfScalarsDataset ` + - \- + * - :py:obj:`JsonListOfDictsOfAnyDataset ` + - \- + * - :py:obj:`JsonListOfListsOfScalarsDataset ` + - \- + * - :py:obj:`JsonListOfListsOfAnyDataset ` + - \- + * - :py:obj:`JsonDictOfScalarsDataset ` + - \- + * - :py:obj:`JsonDictOfAnyDataset ` + - \- + * - :py:obj:`JsonDictOfDictsOfScalarsDataset ` + - \- + * - :py:obj:`JsonDictOfDictsOfAnyDataset ` + - \- + * - :py:obj:`JsonDictOfListsOfScalarsDataset ` + - \- + * - :py:obj:`JsonDictOfListsOfAnyDataset ` + - \- + * - :py:obj:`JsonNestedDictsDataset ` + - \- + * - :py:obj:`JsonListOfNestedDictsDataset ` + - \- + * - :py:obj:`JsonDictOfListsOfDictsOfAnyDataset ` + - \- + + +Classes +------- + + + +.. py:class:: JsonBaseDataset + + Bases: :py:obj:`omnipy.data.dataset.Dataset`\ [\ :py:obj:`JsonModelT`\ ], :py:obj:`Generic`\ [\ :py:obj:`JsonModelT`\ ] + + + + + + +.. py:class:: JsonDataset + + Bases: :py:obj:`JsonBaseDataset`\ [\ :py:obj:`omnipy.modules.json.models.JsonModel`\ ] + + + + + +Attributes +---------- +.. py:data:: JsonModelT + + + +.. py:data:: JsonCustomDataset + :type: TypeAlias + + + +.. py:data:: JsonListOfScalarsDatabase + :type: TypeAlias + + + +.. py:data:: JsonListOfAnyDataset + :type: TypeAlias + + + +.. py:data:: JsonListOfDictsOfScalarsDataset + :type: TypeAlias + + + +.. py:data:: JsonListOfDictsOfAnyDataset + :type: TypeAlias + + + +.. py:data:: JsonListOfListsOfScalarsDataset + :type: TypeAlias + + + +.. py:data:: JsonListOfListsOfAnyDataset + :type: TypeAlias + + + +.. py:data:: JsonDictOfScalarsDataset + :type: TypeAlias + + + +.. py:data:: JsonDictOfAnyDataset + :type: TypeAlias + + + +.. py:data:: JsonDictOfDictsOfScalarsDataset + :type: TypeAlias + + + +.. py:data:: JsonDictOfDictsOfAnyDataset + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfScalarsDataset + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfAnyDataset + :type: TypeAlias + + + +.. py:data:: JsonNestedDictsDataset + :type: TypeAlias + + + +.. py:data:: JsonListOfNestedDictsDataset + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfDictsOfAnyDataset + :type: TypeAlias + + + + + diff --git a/docs/source/autoapi/omnipy/modules/json/flows/index.rst b/docs/source/autoapi/omnipy/modules/json/flows/index.rst new file mode 100644 index 00000000..75f6ad83 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/json/flows/index.rst @@ -0,0 +1,31 @@ + + +omnipy.modules.json.flows +========================= + +.. py:module:: omnipy.modules.json.flows + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`flatten_nested_json `\ (dataset, id_key, ref_key, default_key) + - \- + + + + +Functions +--------- +.. py:function:: flatten_nested_json(dataset: omnipy.modules.json.datasets.JsonListOfDictsOfAnyDataset, id_key: str, ref_key: str, default_key: str) -> omnipy.modules.json.datasets.JsonListOfDictsOfScalarsDataset + + + + + diff --git a/docs/source/autoapi/omnipy/modules/json/functions/index.rst b/docs/source/autoapi/omnipy/modules/json/functions/index.rst new file mode 100644 index 00000000..71f98555 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/json/functions/index.rst @@ -0,0 +1,56 @@ + + +omnipy.modules.json.functions +============================= + +.. py:module:: omnipy.modules.json.functions + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`flatten_outer_level_of_nested_record `\ (nested_record, record_id, data_file_title, id_key, ref_key, default_key) + - \- + * - :py:obj:`ensure_item_first_in_nested_record `\ (nested_record, key, value, fail_if_present) + - \- + * - :py:obj:`update_dict_from_front `\ (dict_a, dict_b) + - \- + * - :py:obj:`transform_into_list_of_dicts `\ (value, default_key) + - \- + * - :py:obj:`add_references_to_parent_in_child_records `\ (child, parent_title, ident, ref_key) + - \- + * - :py:obj:`get_ref_value `\ (data_file_title, ident) + - \- + + + + +Functions +--------- +.. py:function:: flatten_outer_level_of_nested_record(nested_record: omnipy.modules.json.types.JsonDictOfAny, record_id: str, data_file_title: str, id_key: str, ref_key: str, default_key: str) -> Tuple[omnipy.modules.json.types.JsonDictOfScalars, omnipy.modules.json.types.JsonDictOfListsOfDictsOfAny] + + +.. py:function:: ensure_item_first_in_nested_record(nested_record: omnipy.modules.json.types.JsonDictOfAny, key: str, value: str, fail_if_present: bool = False) -> str + + +.. py:function:: update_dict_from_front(dict_a: Dict, dict_b: Dict) -> None + + +.. py:function:: transform_into_list_of_dicts(value: Union[omnipy.modules.json.types.JsonListOfAny, omnipy.modules.json.types.JsonDictOfAny], default_key: str) -> omnipy.modules.json.types.JsonListOfDictsOfAny + + +.. py:function:: add_references_to_parent_in_child_records(child: omnipy.modules.json.types.JsonListOfDictsOfAny, parent_title: str, ident: str, ref_key: str) + + +.. py:function:: get_ref_value(data_file_title: str, ident: str) -> str + + + + + diff --git a/docs/source/autoapi/omnipy/modules/json/index.rst b/docs/source/autoapi/omnipy/modules/json/index.rst new file mode 100644 index 00000000..22e1e530 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/json/index.rst @@ -0,0 +1,23 @@ + + +omnipy.modules.json +=================== + +.. py:module:: omnipy.modules.json + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + datasets/index.rst + flows/index.rst + functions/index.rst + models/index.rst + serializers/index.rst + tasks/index.rst + types/index.rst + + diff --git a/docs/source/autoapi/omnipy/modules/json/models/index.rst b/docs/source/autoapi/omnipy/modules/json/models/index.rst new file mode 100644 index 00000000..03667120 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/json/models/index.rst @@ -0,0 +1,209 @@ + + +omnipy.modules.json.models +========================== + +.. py:module:: omnipy.modules.json.models + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JsonListModel ` + - \- + * - :py:obj:`JsonDictModel ` + - \- + * - :py:obj:`JsonModel ` + - \- + * - :py:obj:`JsonCustomModel ` + - \- + + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`BaseT ` + - \- + * - :py:obj:`JsonSubModelT ` + - \- + * - :py:obj:`JsonSubModel ` + - \- + * - :py:obj:`JsonNoListsSubModel ` + - \- + * - :py:obj:`JsonListOfScalarsModel ` + - \- + * - :py:obj:`JsonListOfAnyModel ` + - \- + * - :py:obj:`JsonListOfDictsOfScalarsModel ` + - \- + * - :py:obj:`JsonListOfDictsOfAnyModel ` + - \- + * - :py:obj:`JsonListOfListsOfScalarsModel ` + - \- + * - :py:obj:`JsonListOfListsOfAnyModel ` + - \- + * - :py:obj:`JsonDictOfScalarsModel ` + - \- + * - :py:obj:`JsonDictOfAnyModel ` + - \- + * - :py:obj:`JsonDictOfDictsOfScalarsModel ` + - \- + * - :py:obj:`JsonDictOfDictsOfAnyModel ` + - \- + * - :py:obj:`JsonDictOfListsOfScalarsModel ` + - \- + * - :py:obj:`JsonDictOfListsOfAnyModel ` + - \- + * - :py:obj:`JsonNestedDictsModel ` + - \- + * - :py:obj:`JsonListOfNestedDictsModel ` + - \- + * - :py:obj:`JsonDictOfListsOfDictsOfAnyModel ` + - \- + + +Classes +------- + + + +.. py:class:: JsonListModel + + Bases: :py:obj:`_JsonBaseModel`\ [\ :py:obj:`List`\ [\ :py:obj:`Optional`\ [\ :py:obj:`JsonSubModelT`\ ]\ ]\ ], :py:obj:`Generic`\ [\ :py:obj:`JsonSubModelT`\ ] + + + + + + +.. py:class:: JsonDictModel + + Bases: :py:obj:`_JsonBaseModel`\ [\ :py:obj:`Dict`\ [\ :py:obj:`str`\ , :py:obj:`Optional`\ [\ :py:obj:`JsonSubModelT`\ ]\ ]\ ], :py:obj:`Generic`\ [\ :py:obj:`JsonSubModelT`\ ] + + + + + + +.. py:class:: JsonModel + + Bases: :py:obj:`_JsonBaseModel`\ [\ :py:obj:`JsonSubModel`\ ] + + + + + + +.. py:class:: JsonCustomModel + + Bases: :py:obj:`_JsonBaseModel`\ [\ :py:obj:`JsonSubModelT`\ ], :py:obj:`Generic`\ [\ :py:obj:`JsonSubModelT`\ ] + + + + + +Attributes +---------- +.. py:data:: BaseT + + + +.. py:data:: JsonSubModelT + + + +.. py:data:: JsonSubModel + :type: TypeAlias + + + +.. py:data:: JsonNoListsSubModel + :type: TypeAlias + + + +.. py:data:: JsonListOfScalarsModel + :type: TypeAlias + + + +.. py:data:: JsonListOfAnyModel + :type: TypeAlias + + + +.. py:data:: JsonListOfDictsOfScalarsModel + :type: TypeAlias + + + +.. py:data:: JsonListOfDictsOfAnyModel + :type: TypeAlias + + + +.. py:data:: JsonListOfListsOfScalarsModel + :type: TypeAlias + + + +.. py:data:: JsonListOfListsOfAnyModel + :type: TypeAlias + + + +.. py:data:: JsonDictOfScalarsModel + :type: TypeAlias + + + +.. py:data:: JsonDictOfAnyModel + :type: TypeAlias + + + +.. py:data:: JsonDictOfDictsOfScalarsModel + :type: TypeAlias + + + +.. py:data:: JsonDictOfDictsOfAnyModel + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfScalarsModel + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfAnyModel + :type: TypeAlias + + + +.. py:data:: JsonNestedDictsModel + :type: TypeAlias + + + +.. py:data:: JsonListOfNestedDictsModel + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfDictsOfAnyModel + :type: TypeAlias + + + + + diff --git a/docs/source/autoapi/omnipy/modules/json/serializers/index.rst b/docs/source/autoapi/omnipy/modules/json/serializers/index.rst new file mode 100644 index 00000000..f434eebf --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/json/serializers/index.rst @@ -0,0 +1,91 @@ + + +omnipy.modules.json.serializers +=============================== + +.. py:module:: omnipy.modules.json.serializers + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JsonDatasetToTarFileSerializer ` + - \- + + + + +Classes +------- + + + +.. py:class:: JsonDatasetToTarFileSerializer + + Bases: :py:obj:`omnipy.data.serializer.TarFileSerializer` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`is_dataset_directly_supported `\ (dataset) + - :summarylabel:`class` \- + * - :py:obj:`get_dataset_cls_for_new `\ () + - :summarylabel:`class` \- + * - :py:obj:`get_output_file_suffix `\ () + - :summarylabel:`class` \- + * - :py:obj:`serialize `\ (json_dataset) + - :summarylabel:`class` \- + * - :py:obj:`deserialize `\ (tarfile_bytes) + - :summarylabel:`class` \- + * - :py:obj:`create_tarfile_from_dataset `\ (dataset, data_encode_func) + - :summarylabel:`class` \- + * - :py:obj:`create_dataset_from_tarfile `\ (dataset, tarfile_bytes, data_decode_func, dictify_object_func, import_method) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: is_dataset_directly_supported(dataset: omnipy.data.dataset.Dataset) -> bool + :classmethod: + + + .. py:method:: get_dataset_cls_for_new() -> Type[omnipy.data.dataset.Dataset] + :classmethod: + + + .. py:method:: get_output_file_suffix() -> str + :classmethod: + + + .. py:method:: serialize(json_dataset: omnipy.modules.json.datasets.JsonDataset) -> Union[bytes, memoryview] + :classmethod: + + + .. py:method:: deserialize(tarfile_bytes: bytes) -> omnipy.modules.json.datasets.JsonDataset + :classmethod: + + + .. py:method:: create_tarfile_from_dataset(dataset: omnipy.data.dataset.Dataset, data_encode_func: Callable[[Any], Union[bytes, memoryview]]) + :classmethod: + + + .. py:method:: create_dataset_from_tarfile(dataset: omnipy.data.dataset.Dataset, tarfile_bytes: bytes, data_decode_func: Callable[[IO[bytes]], Any], dictify_object_func: Callable[[str, Any], Union[Dict, str]], import_method='from_data') + :classmethod: + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/json/tasks/index.rst b/docs/source/autoapi/omnipy/modules/json/tasks/index.rst new file mode 100644 index 00000000..bd3afb02 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/json/tasks/index.rst @@ -0,0 +1,70 @@ + + +omnipy.modules.json.tasks +========================= + +.. py:module:: omnipy.modules.json.tasks + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`convert_dataset_string_to_json `\ (dataset) + - \- + * - :py:obj:`transpose_dataset_of_dicts_to_lists `\ (dataset, id_key) + - \- + * - :py:obj:`flatten_outer_level_of_all_data_files `\ (dataset, id_key, ref_key, default_key) + - \- + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`ID_KEY ` + - \- + * - :py:obj:`REF_KEY ` + - \- + * - :py:obj:`DEFAULT_KEY ` + - \- + + + +Functions +--------- +.. py:function:: convert_dataset_string_to_json(dataset: omnipy.data.dataset.Dataset[omnipy.data.model.Model[str]]) -> omnipy.modules.json.datasets.JsonDataset + + +.. py:function:: transpose_dataset_of_dicts_to_lists(dataset: omnipy.modules.json.datasets.JsonDictOfAnyDataset, id_key: str = ID_KEY) -> omnipy.modules.json.datasets.JsonListOfDictsOfAnyDataset + + +.. py:function:: flatten_outer_level_of_all_data_files(dataset: omnipy.modules.json.datasets.JsonListOfDictsOfAnyDataset, id_key: str, ref_key: str, default_key: str) -> Tuple[omnipy.modules.json.datasets.JsonListOfDictsOfScalarsDataset, omnipy.modules.json.datasets.JsonListOfDictsOfAnyDataset] + + + +Attributes +---------- +.. py:data:: ID_KEY + :value: '_omnipy_id' + + + +.. py:data:: REF_KEY + :value: '_omnipy_ref' + + + +.. py:data:: DEFAULT_KEY + :value: '__root__' + + + + + diff --git a/docs/source/autoapi/omnipy/modules/json/types/index.rst b/docs/source/autoapi/omnipy/modules/json/types/index.rst new file mode 100644 index 00000000..4eb4d06d --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/json/types/index.rst @@ -0,0 +1,188 @@ + + +omnipy.modules.json.types +========================= + +.. py:module:: omnipy.modules.json.types + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JsonList ` + - \- + * - :py:obj:`JsonDict ` + - \- + + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`JsonScalar ` + - \- + * - :py:obj:`JsonT ` + - \- + * - :py:obj:`Json ` + - \- + * - :py:obj:`JsonNoLists ` + - \- + * - :py:obj:`JsonListOfScalars ` + - \- + * - :py:obj:`JsonListOfAny ` + - \- + * - :py:obj:`JsonListOfDictsOfScalars ` + - \- + * - :py:obj:`JsonListOfDictsOfAny ` + - \- + * - :py:obj:`JsonListOfListsOfScalars ` + - \- + * - :py:obj:`JsonListOfListsOfAny ` + - \- + * - :py:obj:`JsonDictOfScalars ` + - \- + * - :py:obj:`JsonDictOfAny ` + - \- + * - :py:obj:`JsonDictOfDictsOfScalars ` + - \- + * - :py:obj:`JsonDictOfDictsOfAny ` + - \- + * - :py:obj:`JsonDictOfListsOfScalars ` + - \- + * - :py:obj:`JsonDictOfListsOfAny ` + - \- + * - :py:obj:`JsonNestedDicts ` + - \- + * - :py:obj:`JsonListOfNestedDicts ` + - \- + * - :py:obj:`JsonDictOfListsOfDictsOfAny ` + - \- + + +Classes +------- + + + +.. py:class:: JsonList + + Bases: :py:obj:`List`\ [\ :py:obj:`JsonT`\ ], :py:obj:`Generic`\ [\ :py:obj:`JsonT`\ ] + + + + + + +.. py:class:: JsonDict + + Bases: :py:obj:`Dict`\ [\ :py:obj:`str`\ , :py:obj:`JsonT`\ ], :py:obj:`Generic`\ [\ :py:obj:`JsonT`\ ] + + + + + +Attributes +---------- +.. py:data:: JsonScalar + :type: TypeAlias + + + +.. py:data:: JsonT + + + +.. py:data:: Json + :type: TypeAlias + + + +.. py:data:: JsonNoLists + :type: TypeAlias + + + +.. py:data:: JsonListOfScalars + :type: TypeAlias + + + +.. py:data:: JsonListOfAny + :type: TypeAlias + + + +.. py:data:: JsonListOfDictsOfScalars + :type: TypeAlias + + + +.. py:data:: JsonListOfDictsOfAny + :type: TypeAlias + + + +.. py:data:: JsonListOfListsOfScalars + :type: TypeAlias + + + +.. py:data:: JsonListOfListsOfAny + :type: TypeAlias + + + +.. py:data:: JsonDictOfScalars + :type: TypeAlias + + + +.. py:data:: JsonDictOfAny + :type: TypeAlias + + + +.. py:data:: JsonDictOfDictsOfScalars + :type: TypeAlias + + + +.. py:data:: JsonDictOfDictsOfAny + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfScalars + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfAny + :type: TypeAlias + + + +.. py:data:: JsonNestedDicts + :type: TypeAlias + + + +.. py:data:: JsonListOfNestedDicts + :type: TypeAlias + + + +.. py:data:: JsonDictOfListsOfDictsOfAny + :type: TypeAlias + + + + + diff --git a/docs/source/autoapi/omnipy/modules/pandas/index.rst b/docs/source/autoapi/omnipy/modules/pandas/index.rst new file mode 100644 index 00000000..a2f97f27 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/pandas/index.rst @@ -0,0 +1,19 @@ + + +omnipy.modules.pandas +===================== + +.. py:module:: omnipy.modules.pandas + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + models/index.rst + serializers/index.rst + tasks/index.rst + + diff --git a/docs/source/autoapi/omnipy/modules/pandas/models/index.rst b/docs/source/autoapi/omnipy/modules/pandas/models/index.rst new file mode 100644 index 00000000..1a758b25 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/pandas/models/index.rst @@ -0,0 +1,86 @@ + + +omnipy.modules.pandas.models +============================ + +.. py:module:: omnipy.modules.pandas.models + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`PandasModel ` + - \- + * - :py:obj:`PandasDataset ` + - \- + * - :py:obj:`ListOfPandasDatasetsWithSameNumberOfFiles ` + - \- + + + + +Classes +------- + + + +.. py:class:: PandasModel + + Bases: :py:obj:`omnipy.data.model.Model`\ [\ :py:obj:`omnipy.modules.pandas.pd.DataFrame`\ ] + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`dict `\ (\*args, \*\*kwargs) + - \- + * - :py:obj:`from_data `\ (value) + - \- + * - :py:obj:`from_json `\ (value) + - \- + + + .. rubric:: Members + + .. py:method:: dict(*args, **kwargs) -> Dict[Any, Any] + + + .. py:method:: from_data(value: collections.abc.Iterable[Any]) -> None + + + .. py:method:: from_json(value: str) -> None + + + + + + +.. py:class:: PandasDataset + + Bases: :py:obj:`omnipy.data.dataset.Dataset`\ [\ :py:obj:`PandasModel`\ ] + + + + + + +.. py:class:: ListOfPandasDatasetsWithSameNumberOfFiles + + Bases: :py:obj:`omnipy.data.model.Model`\ [\ :py:obj:`List`\ [\ :py:obj:`PandasDataset`\ ]\ ] + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/pandas/serializers/index.rst b/docs/source/autoapi/omnipy/modules/pandas/serializers/index.rst new file mode 100644 index 00000000..1e836951 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/pandas/serializers/index.rst @@ -0,0 +1,91 @@ + + +omnipy.modules.pandas.serializers +================================= + +.. py:module:: omnipy.modules.pandas.serializers + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`PandasDatasetToTarFileSerializer ` + - \- + + + + +Classes +------- + + + +.. py:class:: PandasDatasetToTarFileSerializer + + Bases: :py:obj:`omnipy.data.serializer.TarFileSerializer` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`is_dataset_directly_supported `\ (dataset) + - :summarylabel:`class` \- + * - :py:obj:`get_dataset_cls_for_new `\ () + - :summarylabel:`class` \- + * - :py:obj:`get_output_file_suffix `\ () + - :summarylabel:`class` \- + * - :py:obj:`serialize `\ (pandas_dataset) + - :summarylabel:`class` \- + * - :py:obj:`deserialize `\ (tarfile_bytes) + - :summarylabel:`class` \- + * - :py:obj:`create_tarfile_from_dataset `\ (dataset, data_encode_func) + - :summarylabel:`class` \- + * - :py:obj:`create_dataset_from_tarfile `\ (dataset, tarfile_bytes, data_decode_func, dictify_object_func, import_method) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: is_dataset_directly_supported(dataset: omnipy.data.dataset.Dataset) -> bool + :classmethod: + + + .. py:method:: get_dataset_cls_for_new() -> Type[omnipy.data.dataset.Dataset] + :classmethod: + + + .. py:method:: get_output_file_suffix() -> str + :classmethod: + + + .. py:method:: serialize(pandas_dataset: omnipy.modules.pandas.models.PandasDataset) -> Union[bytes, memoryview] + :classmethod: + + + .. py:method:: deserialize(tarfile_bytes: bytes) -> omnipy.modules.pandas.models.PandasDataset + :classmethod: + + + .. py:method:: create_tarfile_from_dataset(dataset: omnipy.data.dataset.Dataset, data_encode_func: Callable[[Any], Union[bytes, memoryview]]) + :classmethod: + + + .. py:method:: create_dataset_from_tarfile(dataset: omnipy.data.dataset.Dataset, tarfile_bytes: bytes, data_decode_func: Callable[[IO[bytes]], Any], dictify_object_func: Callable[[str, Any], Union[Dict, str]], import_method='from_data') + :classmethod: + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/pandas/tasks/index.rst b/docs/source/autoapi/omnipy/modules/pandas/tasks/index.rst new file mode 100644 index 00000000..8e05053b --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/pandas/tasks/index.rst @@ -0,0 +1,51 @@ + + +omnipy.modules.pandas.tasks +=========================== + +.. py:module:: omnipy.modules.pandas.tasks + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`convert_dataset_list_of_dicts_to_pandas `\ (dataset) + - \- + * - :py:obj:`convert_dataset_csv_to_pandas `\ (dataset, delimiter, first_row_as_col_names, col_names, ignore_comments, comments_char) + - \- + * - :py:obj:`convert_dataset_pandas_to_csv `\ (dataset, delimiter, first_row_as_col_names, col_names) + - \- + * - :py:obj:`extract_columns_as_files `\ (dataset, col_names) + - \- + * - :py:obj:`concat_dataframes_across_datasets `\ (dataset_list, vertical) + - \- + + + + +Functions +--------- +.. py:function:: convert_dataset_list_of_dicts_to_pandas(dataset: omnipy.data.dataset.Dataset[omnipy.data.model.Model[List[Dict[str, omnipy.modules.general.models.NotIteratorExceptStrings]]]]) -> omnipy.modules.pandas.models.PandasDataset + + +.. py:function:: convert_dataset_csv_to_pandas(dataset: omnipy.data.dataset.Dataset[omnipy.data.model.Model[bytes]], delimiter: str = ',', first_row_as_col_names=True, col_names: Optional[List[str]] = None, ignore_comments: bool = True, comments_char: str = '#') -> omnipy.modules.pandas.models.PandasDataset + + +.. py:function:: convert_dataset_pandas_to_csv(dataset: omnipy.modules.pandas.models.PandasDataset, delimiter: str = ',', first_row_as_col_names=True, col_names: Optional[List[str]] = None) -> omnipy.data.dataset.Dataset[omnipy.data.model.Model[str]] + + +.. py:function:: extract_columns_as_files(dataset: omnipy.modules.pandas.models.PandasDataset, col_names: List[str]) -> omnipy.modules.pandas.models.PandasDataset + + +.. py:function:: concat_dataframes_across_datasets(dataset_list: omnipy.modules.pandas.models.ListOfPandasDatasetsWithSameNumberOfFiles, vertical=True) -> omnipy.modules.pandas.models.PandasDataset + + + + + diff --git a/docs/source/autoapi/omnipy/modules/prefect/engine/index.rst b/docs/source/autoapi/omnipy/modules/prefect/engine/index.rst new file mode 100644 index 00000000..1322d46a --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/prefect/engine/index.rst @@ -0,0 +1,17 @@ + + +omnipy.modules.prefect.engine +============================= + +.. py:module:: omnipy.modules.prefect.engine + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + prefect/index.rst + + diff --git a/docs/source/autoapi/omnipy/modules/prefect/engine/prefect/index.rst b/docs/source/autoapi/omnipy/modules/prefect/engine/prefect/index.rst new file mode 100644 index 00000000..999a0a03 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/prefect/engine/prefect/index.rst @@ -0,0 +1,104 @@ + + +omnipy.modules.prefect.engine.prefect +===================================== + +.. py:module:: omnipy.modules.prefect.engine.prefect + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`PrefectEngine ` + - Job runner engine for Prefect + + + + +Classes +------- + + + +.. py:class:: PrefectEngine + + Bases: :py:obj:`omnipy.engine.job_runner.TaskRunnerEngine`, :py:obj:`omnipy.engine.job_runner.LinearFlowRunnerEngine`, :py:obj:`omnipy.engine.job_runner.DagFlowRunnerEngine`, :py:obj:`omnipy.engine.job_runner.FuncFlowRunnerEngine` + + Job runner engine for Prefect + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`get_config_cls `\ () + - :summarylabel:`class` Specification of config class mapped to an Engine subclass. Must be implemented by all + * - :py:obj:`apply_task_decorator `\ (task, job_callback_accept_decorator) + - \- + * - :py:obj:`set_config `\ (config) + - \- + * - :py:obj:`set_registry `\ (registry) + - \- + * - :py:obj:`apply_linear_flow_decorator `\ (linear_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`default_linear_flow_run_decorator `\ (linear_flow) + - :summarylabel:`static` \- + * - :py:obj:`apply_dag_flow_decorator `\ (dag_flow, job_callback_accept_decorator) + - \- + * - :py:obj:`default_dag_flow_run_decorator `\ (dag_flow) + - :summarylabel:`static` \- + * - :py:obj:`apply_func_flow_decorator `\ (func_flow, job_callback_accept_decorator) + - \- + + + .. rubric:: Members + + .. py:method:: get_config_cls() -> Type[omnipy.api.protocols.public.config.IsPrefectEngineConfig] + :classmethod: + + Specification of config class mapped to an Engine subclass. Must be implemented by all + subclasses of Engine. If no configuration is needed, then the EngineConfig class should be + returned. + :return: Class implementing the IsEngineConfig protocol + + + .. py:method:: apply_task_decorator(task: omnipy.api.protocols.public.compute.IsTask, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: set_config(config: omnipy.api.protocols.private.engine.IsEngineConfig) -> None + + + .. py:method:: set_registry(registry: Optional[omnipy.api.protocols.private.log.IsRunStateRegistry]) -> None + + + .. py:method:: apply_linear_flow_decorator(linear_flow: omnipy.api.protocols.public.compute.IsLinearFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: default_linear_flow_run_decorator(linear_flow: omnipy.api.protocols.public.compute.IsLinearFlow) -> Any + :staticmethod: + + + .. py:method:: apply_dag_flow_decorator(dag_flow: omnipy.api.protocols.public.compute.IsDagFlow, job_callback_accept_decorator: Callable) -> None + + + .. py:method:: default_dag_flow_run_decorator(dag_flow: omnipy.api.protocols.public.compute.IsDagFlow) -> Any + :staticmethod: + + + .. py:method:: apply_func_flow_decorator(func_flow: omnipy.api.protocols.public.compute.IsFuncFlow, job_callback_accept_decorator: Callable) -> None + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/prefect/index.rst b/docs/source/autoapi/omnipy/modules/prefect/index.rst new file mode 100644 index 00000000..a05362c1 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/prefect/index.rst @@ -0,0 +1,45 @@ + + +omnipy.modules.prefect +====================== + +.. py:module:: omnipy.modules.prefect + + +Subpackages +----------- +.. toctree:: + :titlesonly: + :maxdepth: 3 + + engine/index.rst + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`set_prefect_config_path `\ () + - \- + * - :py:obj:`use_local_api_for_tests `\ () + - \- + + + + +Functions +--------- +.. py:function:: set_prefect_config_path() + + +.. py:function:: use_local_api_for_tests() + + + + + diff --git a/docs/source/autoapi/omnipy/modules/raw/index.rst b/docs/source/autoapi/omnipy/modules/raw/index.rst new file mode 100644 index 00000000..47b8ed93 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/raw/index.rst @@ -0,0 +1,19 @@ + + +omnipy.modules.raw +================== + +.. py:module:: omnipy.modules.raw + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + protocols/index.rst + serializers/index.rst + tasks/index.rst + + diff --git a/docs/source/autoapi/omnipy/modules/raw/protocols/index.rst b/docs/source/autoapi/omnipy/modules/raw/protocols/index.rst new file mode 100644 index 00000000..f972513f --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/raw/protocols/index.rst @@ -0,0 +1,110 @@ + + +omnipy.modules.raw.protocols +============================ + +.. py:module:: omnipy.modules.raw.protocols + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsModifyContentsCallable ` + - \- + * - :py:obj:`IsModifyEachLineCallable ` + - \- + * - :py:obj:`IsModifyAllLinesCallable ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsModifyContentsCallable + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`__call__ `\ (data_file, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: __call__(data_file: str, **kwargs: object) -> str + + + + + + +.. py:class:: IsModifyEachLineCallable + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`__call__ `\ (line_no, line, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: __call__(line_no: int, line: str, **kwargs: object) -> str + + + + + + +.. py:class:: IsModifyAllLinesCallable + + Bases: :py:obj:`Protocol` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`__call__ `\ (all_lines, \*\*kwargs) + - \- + + + .. rubric:: Members + + .. py:method:: __call__(all_lines: List[str], **kwargs: object) -> List[str] + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/raw/serializers/index.rst b/docs/source/autoapi/omnipy/modules/raw/serializers/index.rst new file mode 100644 index 00000000..c27e5775 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/raw/serializers/index.rst @@ -0,0 +1,91 @@ + + +omnipy.modules.raw.serializers +============================== + +.. py:module:: omnipy.modules.raw.serializers + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`RawDatasetToTarFileSerializer ` + - \- + + + + +Classes +------- + + + +.. py:class:: RawDatasetToTarFileSerializer + + Bases: :py:obj:`omnipy.data.serializer.TarFileSerializer` + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`is_dataset_directly_supported `\ (dataset) + - :summarylabel:`class` \- + * - :py:obj:`get_dataset_cls_for_new `\ () + - :summarylabel:`class` \- + * - :py:obj:`get_output_file_suffix `\ () + - :summarylabel:`class` \- + * - :py:obj:`serialize `\ (dataset) + - :summarylabel:`class` \- + * - :py:obj:`deserialize `\ (tarfile_bytes) + - :summarylabel:`class` \- + * - :py:obj:`create_tarfile_from_dataset `\ (dataset, data_encode_func) + - :summarylabel:`class` \- + * - :py:obj:`create_dataset_from_tarfile `\ (dataset, tarfile_bytes, data_decode_func, dictify_object_func, import_method) + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:method:: is_dataset_directly_supported(dataset: omnipy.data.dataset.Dataset) -> bool + :classmethod: + + + .. py:method:: get_dataset_cls_for_new() -> Type[omnipy.data.dataset.Dataset] + :classmethod: + + + .. py:method:: get_output_file_suffix() -> str + :classmethod: + + + .. py:method:: serialize(dataset: omnipy.data.dataset.Dataset[omnipy.data.model.Model[str]]) -> bytes + :classmethod: + + + .. py:method:: deserialize(tarfile_bytes: bytes) -> omnipy.data.dataset.Dataset[omnipy.data.model.Model[str]] + :classmethod: + + + .. py:method:: create_tarfile_from_dataset(dataset: omnipy.data.dataset.Dataset, data_encode_func: Callable[[Any], Union[bytes, memoryview]]) + :classmethod: + + + .. py:method:: create_dataset_from_tarfile(dataset: omnipy.data.dataset.Dataset, tarfile_bytes: bytes, data_decode_func: Callable[[IO[bytes]], Any], dictify_object_func: Callable[[str, Any], Union[Dict, str]], import_method='from_data') + :classmethod: + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/raw/tasks/index.rst b/docs/source/autoapi/omnipy/modules/raw/tasks/index.rst new file mode 100644 index 00000000..f96dea52 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/raw/tasks/index.rst @@ -0,0 +1,41 @@ + + +omnipy.modules.raw.tasks +======================== + +.. py:module:: omnipy.modules.raw.tasks + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`modify_datafile_contents `\ (data_file, modify_contents_func, \*\*kwargs) + - \- + * - :py:obj:`modify_each_line `\ (data_file, modify_line_func, \*\*kwargs) + - \- + * - :py:obj:`modify_all_lines `\ (data_file, modify_all_lines_func, \*\*kwargs) + - \- + + + + +Functions +--------- +.. py:function:: modify_datafile_contents(data_file: str, modify_contents_func: omnipy.modules.raw.protocols.IsModifyContentsCallable, **kwargs: object) -> str + + +.. py:function:: modify_each_line(data_file: str, modify_line_func: omnipy.modules.raw.protocols.IsModifyEachLineCallable, **kwargs: object) -> str + + +.. py:function:: modify_all_lines(data_file: str, modify_all_lines_func: omnipy.modules.raw.protocols.IsModifyAllLinesCallable, **kwargs: object) -> str + + + + + diff --git a/docs/source/autoapi/omnipy/modules/tables/index.rst b/docs/source/autoapi/omnipy/modules/tables/index.rst new file mode 100644 index 00000000..9bce9b22 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/tables/index.rst @@ -0,0 +1,18 @@ + + +omnipy.modules.tables +===================== + +.. py:module:: omnipy.modules.tables + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + models/index.rst + tasks/index.rst + + diff --git a/docs/source/autoapi/omnipy/modules/tables/models/index.rst b/docs/source/autoapi/omnipy/modules/tables/models/index.rst new file mode 100644 index 00000000..443cb97f --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/tables/models/index.rst @@ -0,0 +1,59 @@ + + +omnipy.modules.tables.models +============================ + +.. py:module:: omnipy.modules.tables.models + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`TableOfStrings ` + - \- + * - :py:obj:`JsonTableOfStrings ` + - \- + * - :py:obj:`TableOfStringsAndLists ` + - \- + + + + +Classes +------- + + + +.. py:class:: TableOfStrings + + Bases: :py:obj:`omnipy.data.model.Model`\ [\ :py:obj:`List`\ [\ :py:obj:`Dict`\ [\ :py:obj:`str`\ , :py:obj:`str`\ ]\ ]\ ] + + + + + + +.. py:class:: JsonTableOfStrings + + Bases: :py:obj:`omnipy.modules.json.models.JsonListModel`\ [\ :py:obj:`omnipy.modules.json.models.JsonDictModel`\ [\ :py:obj:`str`\ ]\ ] + + + + + + +.. py:class:: TableOfStringsAndLists + + Bases: :py:obj:`omnipy.data.model.Model`\ [\ :py:obj:`List`\ [\ :py:obj:`Dict`\ [\ :py:obj:`str`\ , :py:obj:`Union`\ [\ :py:obj:`str`\ , :py:obj:`List`\ [\ :py:obj:`str`\ ]\ ]\ ]\ ]\ ] + + + + + + + diff --git a/docs/source/autoapi/omnipy/modules/tables/tasks/index.rst b/docs/source/autoapi/omnipy/modules/tables/tasks/index.rst new file mode 100644 index 00000000..f7e99af7 --- /dev/null +++ b/docs/source/autoapi/omnipy/modules/tables/tasks/index.rst @@ -0,0 +1,31 @@ + + +omnipy.modules.tables.tasks +=========================== + +.. py:module:: omnipy.modules.tables.tasks + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`remove_columns `\ (json_dataset, column_keys_for_data_items) + - \- + + + + +Functions +--------- +.. py:function:: remove_columns(json_dataset: omnipy.modules.json.datasets.JsonListOfDictsOfAnyDataset, column_keys_for_data_items: Dict[str, List[str]]) -> omnipy.modules.json.datasets.JsonListOfDictsOfAnyDataset + + + + + diff --git a/docs/source/autoapi/omnipy/util/callable_decorator_cls/index.rst b/docs/source/autoapi/omnipy/util/callable_decorator_cls/index.rst new file mode 100644 index 00000000..4a057735 --- /dev/null +++ b/docs/source/autoapi/omnipy/util/callable_decorator_cls/index.rst @@ -0,0 +1,39 @@ + + +omnipy.util.callable_decorator_cls +================================== + +.. py:module:: omnipy.util.callable_decorator_cls + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`callable_decorator_cls `\ (cls) + - "Meta-decorator" that allows any class to function as a decorator for a callable. + + + + +Functions +--------- +.. py:function:: callable_decorator_cls(cls: Type[omnipy.api.types.DecoratorClassT]) -> omnipy.api.protocols.private.util.IsCallableClass[omnipy.api.types.DecoratorClassT] + + "Meta-decorator" that allows any class to function as a decorator for a callable. + + The only requirements are that 1) the first argument after self of the __init__() method needs + to be annotated as a callable, and 2) the class must not already be callable (have a __call__() + method). + + Arguments and keyword arguments to the class decorator are supported. + + + + + diff --git a/docs/source/autoapi/omnipy/util/dataframe/index.rst b/docs/source/autoapi/omnipy/util/dataframe/index.rst new file mode 100644 index 00000000..627502f3 --- /dev/null +++ b/docs/source/autoapi/omnipy/util/dataframe/index.rst @@ -0,0 +1,41 @@ + + +omnipy.util.dataframe +===================== + +.. py:module:: omnipy.util.dataframe + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`split_dataframe `\ (df, row_labels_to_move, col_labels_to_move, row_level, col_level) + - \- + * - :py:obj:`select_from_labels `\ (df, labels, axis, level, invert) + - \- + * - :py:obj:`extract_subtable_by_labels `\ (df, row_labels, col_labels, row_level, col_level) + - \- + + + + +Functions +--------- +.. py:function:: split_dataframe(df, row_labels_to_move, col_labels_to_move, row_level=1, col_level=0) + + +.. py:function:: select_from_labels(df, labels, axis, level, invert=False) + + +.. py:function:: extract_subtable_by_labels(df, row_labels=None, col_labels=None, row_level=None, col_level=None) + + + + + diff --git a/docs/source/autoapi/omnipy/util/helpers/index.rst b/docs/source/autoapi/omnipy/util/helpers/index.rst new file mode 100644 index 00000000..8bb854da --- /dev/null +++ b/docs/source/autoapi/omnipy/util/helpers/index.rst @@ -0,0 +1,86 @@ + + +omnipy.util.helpers +=================== + +.. py:module:: omnipy.util.helpers + + +Overview +-------- + + +.. list-table:: Function + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`as_dictable `\ (obj) + - \- + * - :py:obj:`create_merged_dict `\ (dictable_1, dictable_2) + - \- + * - :py:obj:`remove_none_vals `\ (\*\*kwargs) + - \- + * - :py:obj:`get_datetime_format `\ (locale) + - \- + * - :py:obj:`resolve `\ (val) + - \- + * - :py:obj:`repr_max_len `\ (data, max_len) + - \- + * - :py:obj:`get_bases `\ (cls) + - \- + * - :py:obj:`generic_aware_issubclass_ignore_args `\ (cls, cls_or_tuple) + - \- + * - :py:obj:`transfer_generic_args_to_cls `\ (to_cls, from_generic_type) + - \- + + +.. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`Dictable ` + - \- + + + +Functions +--------- +.. py:function:: as_dictable(obj: object) -> Optional[Dictable] + + +.. py:function:: create_merged_dict(dictable_1: Dictable, dictable_2: Dictable) -> Dict[object, object] + + +.. py:function:: remove_none_vals(**kwargs: object) -> Dict[object, object] + + +.. py:function:: get_datetime_format(locale: Optional[omnipy.api.types.LocaleType] = None) -> str + + +.. py:function:: resolve(val) + :async: + + +.. py:function:: repr_max_len(data: object, max_len: int = 200) + + +.. py:function:: get_bases(cls) + + +.. py:function:: generic_aware_issubclass_ignore_args(cls, cls_or_tuple) + + +.. py:function:: transfer_generic_args_to_cls(to_cls, from_generic_type) + + + +Attributes +---------- +.. py:data:: Dictable + + + + + diff --git a/docs/source/autoapi/omnipy/util/index.rst b/docs/source/autoapi/omnipy/util/index.rst new file mode 100644 index 00000000..3459fc2b --- /dev/null +++ b/docs/source/autoapi/omnipy/util/index.rst @@ -0,0 +1,22 @@ + + +omnipy.util +=========== + +.. py:module:: omnipy.util + + +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + + callable_decorator_cls/index.rst + dataframe/index.rst + helpers/index.rst + mixin/index.rst + param_key_mapper/index.rst + publisher/index.rst + + diff --git a/docs/source/autoapi/omnipy/util/mixin/index.rst b/docs/source/autoapi/omnipy/util/mixin/index.rst new file mode 100644 index 00000000..7e61ab34 --- /dev/null +++ b/docs/source/autoapi/omnipy/util/mixin/index.rst @@ -0,0 +1,83 @@ + + +omnipy.util.mixin +================= + +.. py:module:: omnipy.util.mixin + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`IsMixin ` + - \- + * - :py:obj:`DynamicMixinAcceptor ` + - \- + + + + +Classes +------- + + + +.. py:class:: IsMixin(**kwargs: object) + + Bases: :py:obj:`Protocol` + + + + + + +.. py:class:: DynamicMixinAcceptor + + + .. rubric:: Overview + + .. list-table:: Attributes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`WITH_MIXINS_CLS_PREFIX ` + - \- + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`accept_mixin `\ (mixin_cls) + - :summarylabel:`class` \- + * - :py:obj:`reset_mixins `\ () + - :summarylabel:`class` \- + + + .. rubric:: Members + + .. py:attribute:: WITH_MIXINS_CLS_PREFIX + :value: 'WithMixins' + + + + .. py:method:: accept_mixin(mixin_cls: Type) -> None + :classmethod: + + + .. py:method:: reset_mixins() + :classmethod: + + + + + + + diff --git a/docs/source/autoapi/omnipy/util/param_key_mapper/index.rst b/docs/source/autoapi/omnipy/util/param_key_mapper/index.rst new file mode 100644 index 00000000..e426c1ff --- /dev/null +++ b/docs/source/autoapi/omnipy/util/param_key_mapper/index.rst @@ -0,0 +1,62 @@ + + +omnipy.util.param_key_mapper +============================ + +.. py:module:: omnipy.util.param_key_mapper + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`ParamKeyMapper ` + - \- + + + + +Classes +------- + + + +.. py:class:: ParamKeyMapper(key_map: Mapping[str, str]) + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`map_matching_keys `\ (params, inverse, keep_non_matching_keys) + - \- + * - :py:obj:`delete_matching_keys `\ (params, inverse) + - \- + * - :py:obj:`map_matching_keys_delete_inverse_matches_keep_rest `\ (params, inverse) + - \- + + + .. rubric:: Members + + .. py:method:: map_matching_keys(params: Mapping[str, Any], inverse: bool, keep_non_matching_keys: bool) + + + .. py:method:: delete_matching_keys(params: Mapping[str, Any], inverse: bool) + + + .. py:method:: map_matching_keys_delete_inverse_matches_keep_rest(params: Mapping[str, Any], inverse: bool) + + + + + + + diff --git a/docs/source/autoapi/omnipy/util/publisher/index.rst b/docs/source/autoapi/omnipy/util/publisher/index.rst new file mode 100644 index 00000000..d6efcee1 --- /dev/null +++ b/docs/source/autoapi/omnipy/util/publisher/index.rst @@ -0,0 +1,57 @@ + + +omnipy.util.publisher +===================== + +.. py:module:: omnipy.util.publisher + + +Overview +-------- + +.. list-table:: Classes + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`DataPublisher ` + - \- + + + + +Classes +------- + + + +.. py:class:: DataPublisher + + + .. rubric:: Overview + + + .. list-table:: Methods + :header-rows: 0 + :widths: auto + :class: summarytable + + * - :py:obj:`subscribe `\ (config_item, callback_fun) + - \- + * - :py:obj:`unsubscribe_all `\ () + - \- + + + .. rubric:: Members + + .. py:method:: subscribe(config_item: str, callback_fun: Callable[[Any], None]) + + + .. py:method:: unsubscribe_all() -> None + + + + + + +