From b85ee9d64a536937912544c7bbd5b98b635b7e8d Mon Sep 17 00:00:00 2001 From: Christian C Date: Mon, 11 Nov 2024 12:29:32 -0800 Subject: Initial commit --- code/sunlab/environment/base/__init__.py | 8 ++++++++ code/sunlab/environment/base/cpu.py | 4 ++++ code/sunlab/environment/base/cuda.py | 4 ++++ code/sunlab/environment/base/extras.py | 7 +++++++ code/sunlab/environment/base/fortran.py | 8 ++++++++ 5 files changed, 31 insertions(+) create mode 100644 code/sunlab/environment/base/__init__.py create mode 100644 code/sunlab/environment/base/cpu.py create mode 100644 code/sunlab/environment/base/cuda.py create mode 100644 code/sunlab/environment/base/extras.py create mode 100644 code/sunlab/environment/base/fortran.py (limited to 'code/sunlab/environment') diff --git a/code/sunlab/environment/base/__init__.py b/code/sunlab/environment/base/__init__.py new file mode 100644 index 0000000..5fc27c1 --- /dev/null +++ b/code/sunlab/environment/base/__init__.py @@ -0,0 +1,8 @@ +import numpy as np +import pandas as pd +from matplotlib import pyplot as plt +from copy import deepcopy as dc +import glob +from tqdm.notebook import tqdm +from sunlab.common.mathlib.base import * +from .fortran import * diff --git a/code/sunlab/environment/base/cpu.py b/code/sunlab/environment/base/cpu.py new file mode 100644 index 0000000..d969bd1 --- /dev/null +++ b/code/sunlab/environment/base/cpu.py @@ -0,0 +1,4 @@ +import os + +os.environ["CUDA_VISIBLE_DEVICES"] = "-1" +from . import * diff --git a/code/sunlab/environment/base/cuda.py b/code/sunlab/environment/base/cuda.py new file mode 100644 index 0000000..a5c813e --- /dev/null +++ b/code/sunlab/environment/base/cuda.py @@ -0,0 +1,4 @@ +import os + +os.environ["CUDA_VISIBLE_DEVICES"] = "1" +from . import * diff --git a/code/sunlab/environment/base/extras.py b/code/sunlab/environment/base/extras.py new file mode 100644 index 0000000..b6ddc88 --- /dev/null +++ b/code/sunlab/environment/base/extras.py @@ -0,0 +1,7 @@ +from scipy.spatial import KDTree +from scipy.spatial import ConvexHull +from scipy.stats import linregress +from sklearn.manifold import TSNE +from sklearn.decomposition import PCA, KernelPCA +from sklearn.cluster import KMeans +from scipy.optimize import curve_fit diff --git a/code/sunlab/environment/base/fortran.py b/code/sunlab/environment/base/fortran.py new file mode 100644 index 0000000..973d09a --- /dev/null +++ b/code/sunlab/environment/base/fortran.py @@ -0,0 +1,8 @@ +try: + from ...fortran_src.aae_flib_mamba import * +except Exception: + ... +try: + from ...fortran_src.aae_flib_tfnb import * +except Exception: + ... -- cgit v1.2.1