Skip to content

Commit 1fbc80d

Browse files
feat: shorten package import path from pytorch_forecasting to ptf with legacy redirect
1 parent 4757357 commit 1fbc80d

69 files changed

Lines changed: 361 additions & 352 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Add any other context about the problem here.
3939
<!--
4040
Please run the following code snippet and paste the output here:
4141
42-
from pytorch_forecasting import show_versions; show_versions()
42+
from ptf import show_versions; show_versions()
4343
-->
4444

4545
</details>

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,4 @@ lightning_logs
146146
.DS_Store
147147

148148
# data
149-
pytorch_forecasting/data/*.parquet
149+
ptf/data/*.parquet

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Release focusing on:
143143
* Tuner import change due to a Lightning breaking change. Lightning v2.6 introduced a breaking change in its checkpoint loading behavior, which caused unpickling errors during weight loading in `pytorch-forecasting` (see #2000).
144144
To address this, `pytorch-forecasting` now provides its own `Tuner` wrapper that exposes the required `weights_only` argument when calling `lr_find()`.
145145

146-
* When using `pytorch-forecasting > 1.5.0` with `lightning > 2.5`, please use `pytorch_forecasting.tuning.Tuner` in place of `lightning.pytorch.tuner.Tuner`. See #2000 for details.
146+
* When using `pytorch-forecasting > 1.5.0` with `lightning > 2.5`, please use `ptf.tuning.Tuner` in place of `lightning.pytorch.tuner.Tuner`. See #2000 for details.
147147

148148
### Maintenance
149149

@@ -563,7 +563,7 @@ Maintenance update widening compatibility ranges and consolidating dependencies:
563563
### Changed
564564

565565
- Dropping Python 3.6 support, adding 3.10 support (#479)
566-
- Refactored dataloader sampling - moved samplers to pytorch_forecasting.data.samplers module (#479)
566+
- Refactored dataloader sampling - moved samplers to ptf.data.samplers module (#479)
567567
- Changed transformation format for Encoders to dict from tuple (#949)
568568

569569
### Contributors

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ import lightning.pytorch as pl
8383
from lightning.pytorch.loggers import TensorBoardLogger
8484
from lightning.pytorch.callbacks import EarlyStopping, LearningRateMonitor
8585
# import dataset, network to train and metric to optimize
86-
from pytorch_forecasting import TimeSeriesDataSet, TemporalFusionTransformer, QuantileLoss
86+
from ptf import TimeSeriesDataSet, TemporalFusionTransformer, QuantileLoss
8787
from lightning.pytorch.tuner import Tuner
8888

8989
# load data: this is pandas dataframe with at least a column for

docs/source/_ext/model_overview.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sphinx extension to auto-generate model overview table from registry.
22
33
Registers the ``.. model-overview::`` directive which queries the
4-
``pytorch_forecasting._registry.all_objects`` registry, extracts model
4+
``ptf._registry.all_objects`` registry, extracts model
55
tags, and renders an RST table comparing model capabilities.
66
77
"""
@@ -82,7 +82,7 @@ def _get_model_rows():
8282
Each row maps column header to display value. Includes both v1 and v2
8383
models; the Version column distinguishes them.
8484
"""
85-
from pytorch_forecasting._registry import all_objects
85+
from ptf._registry import all_objects
8686

8787
tag_keys = [
8888
"info:name",

docs/source/api_v2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ API v2
55
Please note that the v2 modules are currently in active-development and is in beta right now, so please use this API with caution.
66
See v1 documentation :doc:`here <api>` - it is stable and can be used in the production pipelines.
77

8-
.. currentmodule:: pytorch_forecasting
8+
.. currentmodule:: ptf
99

1010
We are currently developing version 2 of PyTorch Forecasting. The primary objective of this redesign is to improve the software architecture and provide a more intuitive workflow for developers and data scientists.
1111

docs/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
sys.path.insert(0, str(PROJECT_PATH)) # noqa
2626
sys.path.insert(0, str(SOURCE_PATH / "_ext")) # custom Sphinx extensions
2727

28-
import pytorch_forecasting # isort:skip
28+
import ptf # isort:skip
2929

3030
# -- Project information -----------------------------------------------------
3131

@@ -89,7 +89,7 @@ def skip(app, what, name, obj, skip, options):
8989

9090
apidoc_output_folder = SOURCE_PATH.joinpath("api")
9191

92-
PACKAGES = [pytorch_forecasting.__name__]
92+
PACKAGES = [ptf.__name__]
9393

9494

9595
def get_by_name(string: str):
@@ -128,7 +128,7 @@ def get_items(self, names):
128128
if hasattr(obj, "__module__"):
129129
mod_name = obj.__module__
130130
t = f"{mod_name}.{t}"
131-
if t.startswith("pytorch_forecasting"):
131+
if t.startswith("ptf"):
132132
new_names.append(t)
133133
new_items = super().get_items(sorted(new_names))
134134
return new_items

docs/source/data.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Data
88
| Try it out before release: :doc:`v2 Data Pipeline <data_v2>` | :doc:`v2 API Reference <api_v2>`
99
| **Caution: v2 is WIP and unstable. Not yet production-ready.**
1010
11-
.. currentmodule:: pytorch_forecasting.data
11+
.. currentmodule:: ptf.data
1212

1313
Loading data for timeseries forecasting is not trivial - in particular if covariates are included and values are missing.
1414
PyTorch Forecasting provides the :py:class:`~timeseries.TimeSeriesDataSet` which comes with a :py:meth:`~timeseries.TimeSeriesDataSet.to_dataloader`
@@ -25,7 +25,7 @@ Time series data set
2525
The time series dataset is the central data-holding object in PyTorch Forecasting. It primarily takes
2626
a pandas DataFrame along with some metadata. See the :ref:`tutorial on passing data to models <passing-data>` to learn more it is coupled to models.
2727

28-
.. autoclass:: pytorch_forecasting.data.timeseries.TimeSeriesDataSet
28+
.. autoclass:: ptf.data.timeseries.TimeSeriesDataSet
2929
:noindex:
3030
:members: __init__
3131

@@ -34,7 +34,7 @@ Details
3434

3535
See the API documentation for further details on available data encoders and the :py:class:`~timeseries.TimeSeriesDataSet`:
3636

37-
.. currentmodule:: pytorch_forecasting
37+
.. currentmodule:: ptf
3838

3939
.. autosummary::
4040
:toctree: api

docs/source/data_v2.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Data v2
55
Please note that the v2 modules are currently in active-development and is in beta right now, so please use this API with caution.
66
See complete documentation for v2 API :doc:`here <api_v2>` and stable v1 documentation :doc:`here <api>`.
77

8-
.. currentmodule:: pytorch_forecasting
8+
.. currentmodule:: ptf
99

1010
Loading and managing time series data for deep learning can be complex, especially when handling varying sequence lengths, multiple covariates, and categorical encodings.
1111

@@ -22,7 +22,7 @@ The D1 Layer is the foundational data ingestion layer. Its primary responsibilit
2222

2323
Unlike the v1 dataset, the D1 layer does not handle complex preprocessing or batching logic, keeping it lightweight and highly modular.
2424

25-
.. autoclass:: pytorch_forecasting.data.timeseries._timeseries_v2.TimeSeries
25+
.. autoclass:: ptf.data.timeseries._timeseries_v2.TimeSeries
2626
:noindex:
2727
:members: __init__
2828

@@ -43,7 +43,7 @@ Because different forecasting architectures require specific input shapes and st
4343

4444
Each model is optimally designed to be compatible with one or more specific DataModules. You can easily verify which DataModule pairs correctly with your chosen model by checking the compatibility overview table in the **:doc:`v2 Models <models_v2>`** documentation.
4545

46-
.. autoclass:: pytorch_forecasting.data.data_module._tslib_data_module.TslibDataModule
46+
.. autoclass:: ptf.data.data_module._tslib_data_module.TslibDataModule
4747
:noindex:
4848
:members: __init__
4949

@@ -53,7 +53,7 @@ API Reference
5353

5454
See the detailed API documentation for the V2 data classes below:
5555

56-
.. currentmodule:: pytorch_forecasting
56+
.. currentmodule:: ptf
5757

5858
.. autosummary::
5959
:toctree: api

docs/source/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FAQ
22
====
33

4-
.. currentmodule:: pytorch_forecasting
4+
.. currentmodule:: ptf
55

66
Common issues and answers. Other places to seek help from:
77

0 commit comments

Comments
 (0)