From 4d8e03ea0c1b873c943df77ff6fea8c109390a96 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 25 Nov 2024 14:59:43 +0100 Subject: [PATCH 1/4] prune readme --- README.md | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 324b90c..688542d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Lightning Sample project/package +# Lightning Models -This is starter project template which shall simplify initial steps for each new PL project... +...TBD... [![lightning](https://img.shields.io/badge/-Lightning_2.0+-792ee5?logo=pytorchlightning&logoColor=white)](https://lightning.ai/) [![CI testing](https://github.com/Lightning-AI/models/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/models/actions/workflows/ci-testing.yml) @@ -9,32 +9,3 @@ This is starter project template which shall simplify initial steps for each new [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/models/main.svg?badge_token=mqheL1-cTn-280Vx4cJUdg)](https://results.pre-commit.ci/latest/github/Lightning-AI/models/main?badge_token=mqheL1-cTn-280Vx4cJUdg) \* the Read-The-Docs is failing as this one leads to the public domain which requires the repo to be public too - -## Included - -Listing the implemented sections: - -- sample package named `litmodels` -- setting [CI](https://github.com/Lightning-AI/models/actions?query=workflow%3A%22CI+testing%22) for package and _tests_ folder -- setup/install package -- setting docs with Sphinx -- automatic PyPI release on GH release -- Docs deployed as [GH pages](https://Lightning-AI.github.io/models) -- Makefile for building docs with `make docs` and run all tests `make test` - -## To be Done aka cross-check - -You still need to enable some external integrations such as: - -- [ ] update path used in the badges to the repository -- [ ] lock the main breach in GH setting - no direct push without PR -- [ ] set `gh-pages` as website and _docs_ as source folder in GH setting -- [ ] init Read-The-Docs (add this new project) -- [ ] add credentials for releasing package to PyPI -- [ ] specify license in `LICENSE` file and package init - -## Tests / Docs notes - -- We are using [Napoleon style,](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html) and we shall use static types... -- It is nice to se [doctest](https://docs.python.org/3/library/doctest.html) as they are also generated as examples in documentation -- For wider and edge cases testing use [pytest parametrization](https://docs.pytest.org/en/stable/parametrize.html) :\] From 65ca9b22f03f4429f795b087c95c18a3d4430d5e Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 25 Nov 2024 15:07:27 +0100 Subject: [PATCH 2/4] add demo class --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 05c11f1..d4d06d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ # NOTE: once we add more dependencies, consider update dependabot to check for updates lightning-sdk >=0.1.35 +lightning-utilities From 59ae802e327156cede1375589f609899f73873a3 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 25 Nov 2024 15:07:31 +0100 Subject: [PATCH 3/4] add demo class --- src/litmodels/demos/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/litmodels/demos/__init__.py diff --git a/src/litmodels/demos/__init__.py b/src/litmodels/demos/__init__.py new file mode 100644 index 0000000..dacc44e --- /dev/null +++ b/src/litmodels/demos/__init__.py @@ -0,0 +1,14 @@ +"""Define a demos model for examples and testing purposes.""" + +from lightning_utilities import module_available + +__all__ = [] + +if module_available("lightning"): + from lightning.pytorch.demos.boring_classes import BoringModel + + __all__ += ["BoringModel"] +elif module_available("pytorch_lightning"): + from pytorch_lightning.demos.boring_classes import BoringModel + + __all__ += ["BoringModel"] From 88e762fa120f7e4841d5d79a862f2daf3347c421 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 25 Nov 2024 15:10:56 +0100 Subject: [PATCH 4/4] DemoModel --- src/litmodels/demos/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/litmodels/demos/__init__.py b/src/litmodels/demos/__init__.py index dacc44e..d0d0f93 100644 --- a/src/litmodels/demos/__init__.py +++ b/src/litmodels/demos/__init__.py @@ -5,10 +5,10 @@ __all__ = [] if module_available("lightning"): - from lightning.pytorch.demos.boring_classes import BoringModel + from lightning.pytorch.demos.boring_classes import BoringModel, DemoModel - __all__ += ["BoringModel"] + __all__ += ["BoringModel", "DemoModel"] elif module_available("pytorch_lightning"): - from pytorch_lightning.demos.boring_classes import BoringModel + from pytorch_lightning.demos.boring_classes import BoringModel, DemoModel - __all__ += ["BoringModel"] + __all__ += ["BoringModel", "DemoModel"]