This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda create -n ml python=3.8 | |
source activate ml | |
conda install pytorch torchvision torchaudio cudatoolkit=11.2 -c pytorch -c nvidia --yes | |
conda install -c conda-forge seaborn=0.11 --yes | |
conda install -c conda-forge netcdf4 numba tqdm jupyterlab tensorboard ipython pip ruamel.yaml xarray descartes statsmodels scikit-learn black mypy --yes | |
pip install geopandas | |
ipython --pdb -c "import torch; assert torch.cuda.is_available(); print(torch.backends.cudnn.version()); print(torch.cuda.device_count());" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python=3.8 | |
conda create -n ml --yes | |
conda activate ml | |
conda install pytorch torchvision cudatoolkit -c pytorch --yes | |
#ย conda install -c conda-forge seaborn=0.11 --yes3 | |
#ย conda install -c conda-forge jupyterlab=3.0.16 --yes | |
conda install -c conda-forge jupyterlab seaborn --yes | |
conda install -c conda-forge netcdf4 numba tqdm tensorboard ipython pip ruamel.yaml xarray descartes statsmodels scikit-learn black mypy eofs xskillscore cdsapi cftime seaborn gcsfs zarr loguru google-cloud-bigquery --yes | |
conda install -c conda-forge cartopy pyflwdir --yes | |
conda install -c conda-forge pytest pytest-cov --yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xarray as xr | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
from pathlib import Path | |
data_dir = Path("C:\\Users\\anton\\Downloads") | |
preds = xr.open_dataset(data_dir / "preds.nc") | |
f, ax = plt.subplots(figsize=(12, 4)) | |
preds.isel(pixel=0).sel(time="2007").obs.plot(ax=ax, color="k") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda create -n ml --yes python=3.7 | |
conda activate ml | |
conda install tensorflow -c anaconda --yes | |
conda install pytorch torchvision -c pytorch --yes | |
conda install -c conda-forge seaborn=0.11 --yes | |
conda install -c conda-forge netcdf4 numba tqdm jupyterlab tensorboard ipython pip ruamel.yaml xarray descartes statsmodels scikit-learn black mypy --yes | |
conda install -c anaconda spyder | |
python -c "import torch; import xarray" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"golang.org/x/tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
// create a slice of strings with each of the inputs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "golang.org/x/tour/pic" | |
func Formula(x int, y int) uint8 { | |
// return uint8((x + y) / 2) | |
return uint8(x * y) | |
// return uint8(x ^ y) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
today := time.Now().Weekday() | |
fmt.Printf("Today is: %v\n", today) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
const INITIAL_Z = 1 | |
const DELTA = 1e-7 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""[summary] | |
My Question Described: | |
https://stackoverflow.com/questions/67004787/pulp-linear-programming-scheduling-optimisation-constraint-on-consecutive-nigh | |
https://or.stackexchange.com/questions/6070/pulp-scheduling-optimisation-constraint-on-consecutive-shifts-consecutive-ni | |
Minimise: | |
The maximum difference in the numbers of shifts per person...? | |
The cost function defined by hand-coded weights in a data table...? | |
Objective Function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xarray as xr | |
from pathlib import Path | |
if __name__ == "__main__": | |
data_dir = Path("/Users/tommylees/github/spatio_temporal/data") | |
# list(data_dir.glob("*.nc")) | |
ds = xr.open_dataset(data_dir / "camels_static.nc") | |
df = ds.to_dataframe() |