Use per-package imports in docs (#15124)
* fix import to be true stand-alone * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
eb17dc9839
commit
ee07de8136
|
@ -10,7 +10,7 @@ import io
|
|||
import os
|
||||
from contextlib import redirect_stdout
|
||||
|
||||
from lightning.app.testing.testing import application_testing, LightningTestApp
|
||||
from lightning_app.testing.testing import application_testing, LightningTestApp
|
||||
|
||||
|
||||
class LightningAppTestInt(LightningTestApp):
|
||||
|
|
|
@ -126,7 +126,7 @@ def component(component_name: str) -> None:
|
|||
⚡ Use the component inside an app: ⚡
|
||||
|
||||
from {name_for_files} import TemplateComponent
|
||||
import lightning.app as la
|
||||
import lightning_app as la
|
||||
|
||||
class LitApp(la.LightningFlow):
|
||||
def __init__(self) -> None:
|
||||
|
|
|
@ -4,10 +4,10 @@ from typing import Dict, List, Optional, Union
|
|||
from core.components import TensorBoard, WeightsAndBiases
|
||||
from core.components.script_runner import ScriptRunner
|
||||
|
||||
from lightning.app import LightningApp, LightningFlow
|
||||
from lightning.app.frontend import StaticWebFrontend
|
||||
from lightning.app.storage import Path
|
||||
from lightning.app.utilities.packaging.cloud_compute import CloudCompute
|
||||
from lightning_app import LightningApp, LightningFlow
|
||||
from lightning_app.frontend import StaticWebFrontend
|
||||
from lightning_app.storage import Path
|
||||
from lightning_app.utilities.packaging.cloud_compute import CloudCompute
|
||||
|
||||
|
||||
class ReactUI(LightningFlow):
|
||||
|
|
|
@ -4,7 +4,7 @@ from typing import Any, Dict, TYPE_CHECKING, Union
|
|||
from core.state import ProgressBarState, TrainerState
|
||||
|
||||
import pytorch_lightning as pl
|
||||
from lightning.app.storage import Path
|
||||
from lightning_app.storage import Path
|
||||
from lightning_app.utilities.app_helpers import Logger
|
||||
from pytorch_lightning import Callback
|
||||
from pytorch_lightning.callbacks.progress.base import get_standard_metrics
|
||||
|
|
|
@ -2,8 +2,8 @@ import subprocess
|
|||
import time
|
||||
from typing import Dict, List
|
||||
|
||||
from lightning.app import BuildConfig, LightningFlow, LightningWork
|
||||
from lightning.app.storage import Path
|
||||
from lightning_app import BuildConfig, LightningFlow, LightningWork
|
||||
from lightning_app.storage import Path
|
||||
|
||||
|
||||
class TensorBoard(LightningFlow):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
from typing import Dict, List, Optional, TYPE_CHECKING
|
||||
|
||||
from lightning.app import LightningFlow
|
||||
from lightning_app import LightningFlow
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import wandb
|
||||
|
|
|
@ -2,11 +2,10 @@ import sys
|
|||
import traceback
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from lightning.app.components.python import TracerPythonScript
|
||||
from lightning.app.storage import Path
|
||||
from lightning.app.utilities.packaging.build_config import BuildConfig
|
||||
from lightning.app.utilities.tracer import Tracer
|
||||
from lightning_app.utilities.packaging.build_config import load_requirements
|
||||
from lightning_app.components.python import TracerPythonScript
|
||||
from lightning_app.storage import Path
|
||||
from lightning_app.utilities.packaging.build_config import BuildConfig, load_requirements
|
||||
from lightning_app.utilities.tracer import Tracer
|
||||
|
||||
|
||||
class ScriptRunner(TracerPythonScript):
|
||||
|
|
|
@ -5,7 +5,7 @@ import pytest
|
|||
from core.callbacks import PLAppArtifactsTracker, PLAppProgressTracker, PLAppSummary
|
||||
from core.components.script_runner import ScriptRunner
|
||||
|
||||
from lightning.app.storage import Path
|
||||
from lightning_app.storage import Path
|
||||
from pytorch_lightning import LightningModule, Trainer
|
||||
from pytorch_lightning.loggers import TensorBoardLogger
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
from pathlib import Path
|
||||
|
||||
import lightning as L
|
||||
from lightning.app import frontend
|
||||
from lightning_app import frontend
|
||||
|
||||
|
||||
class YourComponent(L.LightningFlow):
|
||||
|
|
|
@ -126,8 +126,8 @@ class LightningTrainingComponent(LightningFlow):
|
|||
Example::
|
||||
|
||||
from lightning import LightningApp
|
||||
from lightning.app.components.training import LightningTrainingComponent
|
||||
from lightning.app.utilities.packaging.cloud_compute import CloudCompute
|
||||
from lightning_app.components.training import LightningTrainingComponent
|
||||
from lightning_app.utilities.packaging.cloud_compute import CloudCompute
|
||||
|
||||
app = LightningApp(
|
||||
LightningTrainingComponent(
|
||||
|
|
|
@ -57,9 +57,9 @@ class LightningApp:
|
|||
created by other users.
|
||||
|
||||
The Lightning App alternatively run an event loop triggered by delta changes sent from
|
||||
either :class:`~lightning.app.core.work.LightningWork` or from the Lightning UI.
|
||||
either :class:`~lightning_app.core.work.LightningWork` or from the Lightning UI.
|
||||
Once deltas are received, the Lightning App runs
|
||||
the :class:`~lightning.app.core.flow.LightningFlow` provided.
|
||||
the :class:`~lightning_app.core.flow.LightningFlow` provided.
|
||||
|
||||
Arguments:
|
||||
root: The root LightningFlow component, that defines all the app's nested components, running infinitely.
|
||||
|
@ -77,7 +77,7 @@ class LightningApp:
|
|||
.. doctest::
|
||||
|
||||
>>> from lightning import LightningFlow, LightningApp
|
||||
>>> from lightning.app.runners import MultiProcessRuntime
|
||||
>>> from lightning_app.runners import MultiProcessRuntime
|
||||
>>> class RootFlow(LightningFlow):
|
||||
... def run(self):
|
||||
... print("Hello World!")
|
||||
|
|
|
@ -50,7 +50,7 @@ class PanelFrontend(Frontend):
|
|||
.. code-block:: python
|
||||
|
||||
import lightning as L
|
||||
from lightning.app.frontend.panel import PanelFrontend
|
||||
from lightning_app.frontend.panel import PanelFrontend
|
||||
|
||||
|
||||
class LitPanel(L.LightningFlow):
|
||||
|
|
|
@ -5,7 +5,7 @@ from urllib.parse import urlparse
|
|||
from lightning_cloud.openapi import ApiClient, AuthServiceApi, V1LoginRequest
|
||||
from websocket import WebSocketApp
|
||||
|
||||
from lightning.app.core import constants
|
||||
from lightning_app.core import constants
|
||||
from lightning_app.utilities.login import Auth
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue