Skip to content

Commit 5c1000a

Browse files
committed
Initial commit
0 parents  commit 5c1000a

File tree

163 files changed

+13550
-0
lines changed

Some content is hidden

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

163 files changed

+13550
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# tsl: a PyTorch library for spatiotemporal data processing
2+
3+
4+
**tsl** *(Torch Spatiotemporal)* is a library built to accelerate research on neural spatiotemporal data processing
5+
methods, with a focus on Graph Neural Networks.
6+
7+
`tsl` is built on several libraries of the *Python* scientific computing ecosystem, with the final objective of providing a straightforward process that goes from data preprocessing to model prototyping.
8+
In particular, `tsl` offers a wide range of utilities to develop neural networks in *PyTorch* for processing spatiotemporal data signals.
9+
10+
## Installation
11+
`tsl` is compatible with Python 3.7 and above. We recommend using Anaconda and the provided environment configuration by running the command:
12+
13+
```conda env create -f tsl_env.yml```
14+
15+
To install `tsl` from source, run this in a terminal:
16+
17+
```bash
18+
git clone https://github.com/TorchSpatiotemporal/tsl.git
19+
cd tsl
20+
python setup.py install # Or 'pip install .'
21+
```
22+
23+
## Tutorial
24+
25+
The best way to start using `tsl` is by following the tutorial notebook in `examples/notebooks/a_gentle_introduction_to_tsl.ipynb`.
26+
27+
## Documentation
28+
29+
The documentation can be built and accessed from `docs`.
30+
31+
## Credits
32+
33+
[Andrea Cini](https://andreacini.github.io/), [Ivan Marisca](https://marshka.github.io/)

docs/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SPHINXBUILD = sphinx-build
2+
SPHINXPROJ = tsl
3+
SOURCEDIR = source
4+
BUILDDIR = build
5+
6+
help:
7+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
8+
9+
.PHONY: help Makefile
10+
11+
%: Makefile
12+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0)

docs/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Building Documentation
2+
3+
To build the documentation:
4+
5+
1. Install [Sphinx](https://www.sphinx-doc.org/en/master/) via `pip install -r requirements.txt`.
6+
2. Generate the documentation file via:
7+
8+
```
9+
cd docs
10+
make html
11+
```
12+
13+
The documentation is now available to view by opening `docs/build/html/index.html`.

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sphinx==4.2.0
2+
sphinx_rtd_theme==1.0.0

docs/source/_static/css/custom.css

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
@import "theme.css";
2+
3+
.wy-side-nav-search .wy-dropdown > a img.logo, .wy-side-nav-search > a img.logo {
4+
height: 150px;
5+
}
6+
7+
.wy-side-nav-search {
8+
background: rgb(243,244,247);
9+
}
10+
11+
.wy-side-nav-search > div.version {
12+
color: black;
13+
}
14+
15+
.wy-nav-content-wrap {
16+
background: inherit;
17+
}
18+
19+
.wy-side-nav-search input[type="text"] {
20+
border: none;
21+
box-shadow: none;
22+
background: white;
23+
border-radius: 0;
24+
font-size: 100%;
25+
}
26+
27+
.wy-menu-vertical li.current a,
28+
.wy-menu-vertical li.toctree-l1.current > a {
29+
border: none;
30+
}
31+
32+
.ethical-rtd > div.ethical-sidebar,
33+
.ethical-rtd > div.ethical-footer {
34+
display: none !important;
35+
}
36+
37+
h1 {
38+
text-transform: uppercase;
39+
font-family: inherit;
40+
font-weight: 200;
41+
}
42+
43+
h2,
44+
.rst-content .toctree-wrapper p.caption {
45+
font-family: inherit;
46+
font-weight: 200;
47+
}
48+
49+
.rst-content a:visited {
50+
color: #3091d1;
51+
}
52+
53+
/* Begin code */
54+
.rst-content pre.literal-block,
55+
.rst-content div[class^="highlight"] {
56+
border: none;
57+
}
58+
59+
.rst-content pre.literal-block,
60+
.rst-content div[class^="highlight"] pre,
61+
.rst-content .linenodiv pre {
62+
font-size: 80%;
63+
}
64+
65+
.highlight {
66+
background: #f6f8fa;
67+
border-radius: 6px;
68+
}
69+
70+
.highlight .kn,
71+
.highlight .k {
72+
color: #d73a49;
73+
}
74+
75+
.highlight .nn {
76+
color: inherit;
77+
font-weight: inherit;
78+
}
79+
80+
.highlight .nc {
81+
color: #e36209;
82+
font-weight: inherit;
83+
}
84+
85+
.highlight .fm,
86+
.highlight .nd,
87+
.highlight .nf,
88+
.highlight .nb {
89+
color: #6f42c1;
90+
}
91+
92+
.highlight .bp,
93+
.highlight .n {
94+
color: inherit;
95+
}
96+
97+
.highlight .kc,
98+
.highlight .s1,
99+
.highlight .s2,
100+
.highlight .mi,
101+
.highlight .mf,
102+
.highlight .bp,
103+
.highlight .bn,
104+
.highlight .ow {
105+
color: #005cc5;
106+
font-weight: inherit;
107+
}
108+
109+
.highlight .c1 {
110+
color: #6a737d;
111+
}
112+
113+
.rst-content code.xref {
114+
padding: .2em .4em;
115+
background: rgba(27,31,35,.05);
116+
border-radius: 6px;
117+
border: none;
118+
}
119+
/* End code */
120+
121+
.rst-content dl:not(.docutils) dt,
122+
.rst-content dl:not(.docutils) dl dt {
123+
background: rgb(243,244,247);
124+
}
125+
126+
.rst-content dl:not(.docutils) dt.field-odd {
127+
text-transform: uppercase;
128+
background: inherit;
129+
border: none;
130+
padding: 6px 0;
131+
}
132+
133+
.rst-content dl:not(.docutils) .property:first-child .pre {
134+
text-transform: uppercase;
135+
font-style: normal;
136+
}
137+
138+
em.sig-param span.n:first-child, em.sig-param span.n:nth-child(2) {
139+
color: black;
140+
font-style: normal;
141+
}
142+
143+
em.sig-param span.n:nth-child(3),
144+
em.sig-param span.n:nth-child(3) a {
145+
color: inherit;
146+
font-weight: normal;
147+
font-style: normal;
148+
}
149+
150+
em.sig-param span.default_value {
151+
font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;
152+
font-style: normal;
153+
font-size: 90%;
154+
}
155+
156+
.sig-paren {
157+
padding: 0 4px;
158+
}
159+
160+
.wy-table-responsive table td,
161+
.wy-table-responsive table th {
162+
white-space: normal;
163+
}
164+
165+
.wy-table-bordered-all,
166+
.rst-content table.docutils {
167+
border: none;
168+
}
169+
170+
.wy-table-bordered-all td,
171+
.rst-content table.docutils td {
172+
border: none;
173+
}
174+
175+
.wy-table-odd td,
176+
.wy-table-striped tr:nth-child(2n-1) td,
177+
.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td {
178+
background: rgb(243,244,247);
179+
}
180+
181+
.wy-table td,
182+
.rst-content table.docutils td,
183+
.rst-content table.field-list td,
184+
.wy-table th,
185+
.rst-content table.docutils th,
186+
.rst-content table.field-list th {
187+
padding: 14px;
188+
}
189+
190+
table.colwidths-given tr td p,
191+
table.colwidths-given tr th p {
192+
text-align: center;
193+
}
194+
195+
table.colwidths-given tr td:first-child p,
196+
table.colwidths-given tr th:first-child p {
197+
text-align: left;
198+
}

docs/source/_static/img/tsl_logo.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/source/conf.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import datetime
2+
import sphinx_rtd_theme
3+
import doctest
4+
import tsl
5+
6+
extensions = [
7+
'sphinx.ext.autodoc',
8+
'sphinx.ext.autosummary',
9+
'sphinx.ext.doctest',
10+
'sphinx.ext.intersphinx',
11+
'sphinx.ext.mathjax',
12+
'sphinx.ext.napoleon',
13+
'sphinx.ext.viewcode',
14+
'sphinx.ext.githubpages',
15+
]
16+
17+
autosummary_generate = True
18+
templates_path = ['_templates']
19+
20+
source_suffix = '.rst'
21+
master_doc = 'index'
22+
23+
# exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
24+
25+
# -- Project information -----------------------------------------------------
26+
project = 'tsl'
27+
author = 'Andrea Cini, Ivan Marisca'
28+
copyright = '{}, {}'.format(datetime.datetime.now().year, author)
29+
30+
version = tsl.__version__
31+
release = tsl.__version__
32+
33+
html_theme = 'sphinx_rtd_theme'
34+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
35+
36+
doctest_default_flags = doctest.NORMALIZE_WHITESPACE
37+
autodoc_member_order = 'bysource'
38+
intersphinx_mapping = {
39+
'python': ('https://docs.python.org/3/', None),
40+
'numpy': ('https://numpy.org/doc/stable/', None),
41+
'pd': ('https://pandas.pydata.org/docs/', None),
42+
'PyTorch': ('https://pytorch.org/docs/stable/', None),
43+
'pytorch_lightning': ('https://pytorch-lightning.readthedocs.io/en/latest/', None),
44+
'PyG': ('https://pytorch-geometric.readthedocs.io/en/latest/', None)
45+
}
46+
47+
html_theme_options = {
48+
'collapse_navigation': False,
49+
'display_version': True,
50+
'logo_only': True,
51+
'navigation_depth': 2,
52+
}
53+
54+
html_static_path = ['_static']
55+
html_logo = '_static/img/tsl_logo.svg'
56+
html_favicon = '_static/img/tsl_logo.svg'
57+
58+
html_context = {'css_files': ['_static/css/custom.css']}
59+
rst_context = {'tsl': tsl}
60+
61+
add_module_names = False
62+
63+
def setup(app):
64+
def skip(app, what, name, obj, skip, options):
65+
members = [
66+
'__init__',
67+
'__repr__',
68+
'__weakref__',
69+
'__dict__',
70+
'__module__',
71+
]
72+
return True if name in members else skip
73+
74+
def rst_jinja_render(app, docname, source):
75+
src = source[0]
76+
rendered = app.builder.templates.render_string(src, rst_context)
77+
source[0] = rendered
78+
79+
app.connect('autodoc-skip-member', skip)
80+
app.connect("source-read", rst_jinja_render)

docs/source/index.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
:github_url: https://github.com/TorchSpatiotemporal/tsl
2+
3+
Torch Spatiotemporal
4+
====================
5+
6+
tsl (Torch Spatiotemporal) is a library built to accelerate research on neural spatiotemporal data processing methods, with a focus on Graph Neural Networks.
7+
8+
It is built on several libraries of the Python scientific computing ecosystem, with the final objective of providing a straightforward process that goes from data preprocessing to model prototyping. In particular, tsl offers a wide range of utilities to develop neural networks in `PyTorch <https://pytorch.org/>`_ and `PyG <https://github.com/pyg-team/pytorch_geometric/>`_ for processing spatiotemporal data signals.
9+
10+
.. toctree::
11+
:glob:
12+
:maxdepth: 1
13+
:caption: Usage
14+
15+
notes/data_format
16+
17+
.. toctree::
18+
:glob:
19+
:maxdepth: 1
20+
:caption: Package API
21+
22+
modules/data
23+
modules/data_datamodule
24+
modules/data_preprocessing
25+
modules/datasets
26+
modules/nn
27+
modules/inference_modules
28+
29+
30+
Indices and Tables
31+
==================
32+
33+
* :ref:`genindex`
34+
* :ref:`modindex`

0 commit comments

Comments
 (0)