Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data for Colab / colorblind setting #373

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/source/_rst/tutorials/tutorial10/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ operations.
IN_COLAB = False
if IN_COLAB:
!pip install "pina-mathlab"
!mkdir "data"
!wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS.mat" -O "data/Data_KS.mat"
!wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS2.mat" -O "data/Data_KS2.mat"


import torch
import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
from scipy import io
from pina import Condition, LabelTensor
from pina.problem import AbstractProblem
Expand Down
1 change: 1 addition & 0 deletions docs/source/_rst/tutorials/tutorial4/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ First of all we import the modules needed for the tutorial:

import torch
import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
from pina.problem import AbstractProblem
from pina.solvers import SupervisedSolver
from pina.trainer import Trainer
Expand Down
4 changes: 4 additions & 0 deletions docs/source/_rst/tutorials/tutorial5/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ First of all we import the modules needed for the tutorial. Importing
if IN_COLAB:
!pip install "pina-mathlab"
!pip install scipy
# get the data
!wget https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial5/Data_Darcy.mat


# !pip install scipy # install scipy
from scipy import io
Expand All @@ -33,6 +36,7 @@ First of all we import the modules needed for the tutorial. Importing
from pina.trainer import Trainer
from pina.problem import AbstractProblem
import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')

Data Generation
---------------
Expand Down
1 change: 1 addition & 0 deletions docs/source/_rst/tutorials/tutorial6/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ We import the relevant modules first.
!pip install "pina-mathlab"

import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
from pina.geometry import EllipsoidDomain, Difference, CartesianDomain, Union, SimplexDomain
from pina.label_tensor import LabelTensor

Expand Down
6 changes: 6 additions & 0 deletions docs/source/_rst/tutorials/tutorial7/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ In order to achieve both the goals we will need to define an
IN_COLAB = False
if IN_COLAB:
!pip install "pina-mathlab"
# get the data
!mkdir "data"
!wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5" -O "data/pinn_solution_0.5_0.5"
!wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pts_0.5_0.5" -O "data/pts_0.5_0.5"


import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
import torch
from pytorch_lightning.callbacks import Callback
from pina.problem import SpatialProblem, InverseProblem
Expand Down
1 change: 1 addition & 0 deletions docs/source/_rst/tutorials/tutorial8/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ minimum PINA version to run this tutorial is the ``0.1``.
%matplotlib inline

import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
import torch
import pina

Expand Down
1 change: 1 addition & 0 deletions docs/source/_rst/tutorials/tutorial9/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ First of all, some useful imports.

import torch
import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')

from pina import Condition, Plotter
from pina.problem import SpatialProblem
Expand Down
7 changes: 6 additions & 1 deletion tutorials/tutorial10/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@
" IN_COLAB = False\n",
"if IN_COLAB:\n",
" !pip install \"pina-mathlab\"\n",
" # get the data\n",
" !mkdir \"data\"\n",
" !wget \"https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS.mat\" -O \"data/Data_KS.mat\"\n",
" !wget \"https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS2.mat\" -O \"data/Data_KS2.mat\"\n",
"\n",
"import torch\n",
"import matplotlib.pyplot as plt\n",
"plt.style.use('tableau-colorblind10')\n",
"from scipy import io\n",
"from pina import Condition, LabelTensor\n",
"from pina.problem import AbstractProblem\n",
Expand Down Expand Up @@ -99,7 +104,7 @@
],
"source": [
"# load data\n",
"data=io.loadmat(\"dat/Data_KS.mat\")\n",
"data=io.loadmat(\"data/Data_KS.mat\")\n",
"\n",
"# converting to label tensor\n",
"initial_cond_train = LabelTensor(torch.tensor(data['initial_cond_train'], dtype=torch.float), ['t','x','u0'])\n",
Expand Down
5 changes: 5 additions & 0 deletions tutorials/tutorial10/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@
IN_COLAB = False
if IN_COLAB:
get_ipython().system('pip install "pina-mathlab"')
# get the data
get_ipython().system('mkdir "data"')
get_ipython().system('wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS.mat" -O "data/Data_KS.mat"')
get_ipython().system('wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS2.mat" -O "data/Data_KS2.mat"')

import torch
import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
from scipy import io
from pina import Condition, LabelTensor
from pina.problem import AbstractProblem
Expand Down
1 change: 1 addition & 0 deletions tutorials/tutorial4/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"\n",
"import torch \n",
"import matplotlib.pyplot as plt \n",
"plt.style.use('tableau-colorblind10')\n",
"from pina.problem import AbstractProblem\n",
"from pina.solvers import SupervisedSolver\n",
"from pina.trainer import Trainer\n",
Expand Down
3 changes: 2 additions & 1 deletion tutorials/tutorial4/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# First of all we import the modules needed for the tutorial:

# In[1]:
# In[ ]:


## routine needed to run the notebook on Google Colab
Expand All @@ -23,6 +23,7 @@

import torch
import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
from pina.problem import AbstractProblem
from pina.solvers import SupervisedSolver
from pina.trainer import Trainer
Expand Down
6 changes: 5 additions & 1 deletion tutorials/tutorial5/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"if IN_COLAB:\n",
" !pip install \"pina-mathlab\"\n",
" !pip install scipy\n",
" # get the data\n",
" !wget https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial5/Data_Darcy.mat\n",
"\n",
" \n",
"# !pip install scipy # install scipy\n",
"from scipy import io\n",
Expand All @@ -44,7 +47,8 @@
"from pina.solvers import SupervisedSolver\n",
"from pina.trainer import Trainer\n",
"from pina.problem import AbstractProblem\n",
"import matplotlib.pyplot as plt"
"import matplotlib.pyplot as plt\n",
"plt.style.use('tableau-colorblind10')"
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions tutorials/tutorial5/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
if IN_COLAB:
get_ipython().system('pip install "pina-mathlab"')
get_ipython().system('pip install scipy')
# get the data
get_ipython().system('wget https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial5/Data_Darcy.mat')


# !pip install scipy # install scipy
from scipy import io
Expand All @@ -31,6 +34,7 @@
from pina.trainer import Trainer
from pina.problem import AbstractProblem
import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')


# ## Data Generation
Expand Down
1 change: 1 addition & 0 deletions tutorials/tutorial6/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
" !pip install \"pina-mathlab\"\n",
"\n",
"import matplotlib.pyplot as plt\n",
"plt.style.use('tableau-colorblind10')\n",
"from pina.geometry import EllipsoidDomain, Difference, CartesianDomain, Union, SimplexDomain\n",
"from pina.label_tensor import LabelTensor\n",
"\n",
Expand Down
1 change: 1 addition & 0 deletions tutorials/tutorial6/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
get_ipython().system('pip install "pina-mathlab"')

import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
from pina.geometry import EllipsoidDomain, Difference, CartesianDomain, Union, SimplexDomain
from pina.label_tensor import LabelTensor

Expand Down
5 changes: 5 additions & 0 deletions tutorials/tutorial7/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@
" IN_COLAB = False\n",
"if IN_COLAB:\n",
" !pip install \"pina-mathlab\"\n",
" # get the data\n",
" !mkdir \"data\"\n",
" !wget \"https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5\" -O \"data/pinn_solution_0.5_0.5\"\n",
" !wget \"https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pts_0.5_0.5\" -O \"data/pts_0.5_0.5\"\n",
" \n",
"import matplotlib.pyplot as plt\n",
"plt.style.use('tableau-colorblind10')\n",
"import torch\n",
"from pytorch_lightning.callbacks import Callback\n",
"from pina.problem import SpatialProblem, InverseProblem\n",
Expand Down
5 changes: 5 additions & 0 deletions tutorials/tutorial7/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@
IN_COLAB = False
if IN_COLAB:
get_ipython().system('pip install "pina-mathlab"')
# get the data
get_ipython().system('mkdir "data"')
get_ipython().system('wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5" -O "data/pinn_solution_0.5_0.5"')
get_ipython().system('wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pts_0.5_0.5" -O "data/pts_0.5_0.5"')

import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
import torch
from pytorch_lightning.callbacks import Callback
from pina.problem import SpatialProblem, InverseProblem
Expand Down
1 change: 1 addition & 0 deletions tutorials/tutorial8/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"%matplotlib inline\n",
"\n",
"import matplotlib.pyplot as plt\n",
"plt.style.use('tableau-colorblind10')\n",
"import torch\n",
"import pina\n",
"\n",
Expand Down
1 change: 1 addition & 0 deletions tutorials/tutorial8/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
get_ipython().run_line_magic('matplotlib', 'inline')

import matplotlib.pyplot as plt
plt.style.use('tableau-colorblind10')
import torch
import pina

Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial9/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"\n",
"import torch\n",
"import matplotlib.pyplot as plt\n",
"\n",
"plt.style.use('tableau-colorblind10')\n",
"from pina import Condition, Plotter\n",
"from pina.problem import SpatialProblem\n",
"from pina.operators import laplacian\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial9/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import torch
import matplotlib.pyplot as plt

plt.style.use('tableau-colorblind10')
from pina import Condition, Plotter
from pina.problem import SpatialProblem
from pina.operators import laplacian
Expand Down
Loading