keyword
stringclasses
7 values
repo_name
stringlengths
8
98
file_path
stringlengths
4
244
file_extension
stringclasses
29 values
file_size
int64
0
84.1M
line_count
int64
0
1.6M
content
stringlengths
1
84.1M
language
stringclasses
14 values
2D
cbouy/mols2grid
DEVELOPMENT.md
.md
2,333
71
This is a short guide to setup a dev environment for mols2grid. 1. Install [uv](https://docs.astral.sh/uv/) 2. Create a new environment and install: ``` uv sync --python 3.11 ``` We use [poethepoet](https://poethepoet.natn.io/) to define tasks to run in development environments. You can run all of the checks...
Markdown
2D
cbouy/mols2grid
mols2grid/datafiles.py
.py
331
11
import atexit from contextlib import ExitStack from importlib import resources _file_manager = ExitStack() atexit.register(_file_manager.close) _data_resource = resources.files("mols2grid") / "data/" datapath = _file_manager.enter_context(resources.as_file(_data_resource)) SOLUBILITY_SDF = str(datapath / "solubility....
Python
2D
cbouy/mols2grid
mols2grid/__init__.py
.py
619
17
from mols2grid import datafiles as datafiles from mols2grid._version import __version__ as __version__ from mols2grid.callbacks import make_popup_callback as make_popup_callback from mols2grid.dispatch import display as display from mols2grid.dispatch import save as save from mols2grid.molgrid import MolGrid as MolGrid...
Python
2D
cbouy/mols2grid
mols2grid/callbacks.py
.py
6,334
183
from typing import NamedTuple from mols2grid.utils import env class _JSCallback(NamedTuple): """Class that holds JavaScript code for running a callback function. If an external library is required for the callback to function correctly, it can be passed in the optional ``library_src`` as a ``<script>`` t...
Python
2D
cbouy/mols2grid
mols2grid/select.py
.py
1,810
64
import warnings from ast import literal_eval from mols2grid.utils import is_running_within_marimo class SelectionRegister: """Register for grid selections Attributes ---------- SELECTIONS : dict Stores each grid selection according to their name current_selection : str Name of th...
Python
2D
cbouy/mols2grid
mols2grid/utils.py
.py
3,946
146
import gzip import re from ast import literal_eval from functools import partial, wraps from importlib.util import find_spec from pathlib import Path import pandas as pd from jinja2 import Environment, FileSystemLoader from rdkit import Chem env = Environment( loader=FileSystemLoader(Path(__file__).parent / "temp...
Python
2D
cbouy/mols2grid
mols2grid/dispatch.py
.py
12,747
303
import inspect from functools import singledispatch from pathlib import Path from pandas import DataFrame, Series from mols2grid.molgrid import MolGrid _SIGNATURE = { method: dict(inspect.signature(getattr(MolGrid, method)).parameters.items()) for method in ["render", "to_interactive", "to_static", "display"...
Python
2D
cbouy/mols2grid
mols2grid/widget.py
.py
1,108
36
from pathlib import Path import anywidget from traitlets import Bool, List, Unicode from mols2grid._version import __version__ # noqa: F401 BUNDLER_OUTPUT_DIR = Path(__file__).parent / "static" class MolGridWidget(anywidget.AnyWidget): """A custom widget for the MolGrid class. Handles selections and callbacks...
Python
2D
cbouy/mols2grid
mols2grid/_version.py
.py
22
2
__version__ = "2.2.0"
Python
2D
cbouy/mols2grid
mols2grid/molgrid.py
.py
43,650
1,137
import ast import json import warnings from base64 import b64encode from functools import partial from html import escape import numpy as np import pandas as pd from rdkit import Chem from rdkit.Chem import Draw from mols2grid.callbacks import _JSCallback from mols2grid.select import register from mols2grid.utils imp...
Python
2D
cbouy/mols2grid
mols2grid/templates/__init__.py
.py
0
0
null
Python
2D
cbouy/mols2grid
docs/contents.md
.md
6,489
116
# 💡 Introduction - [![Pypi version](https://img.shields.io/pypi/v/mols2grid.svg)](https://pypi.python.org/pypi/mols2grid) [![Conda version](https://img.shields.io/conda/vn/conda-forge/mols2grid)](https://anaconda.org/conda-forge/mols2grid) - [![Tests status](https://github.com/cbouy/mols2grid/workflows/CI/badge.sv...
Markdown
2D
cbouy/mols2grid
docs/conf.py
.py
4,097
133
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
Python
2D
cbouy/mols2grid
docs/notebooks/customization.ipynb
.ipynb
5,589
176
{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Customization\n", "\n", "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/cbouy/mols2grid/blob/master/docs/notebooks/customization.ipy...
Unknown
2D
cbouy/mols2grid
docs/notebooks/callbacks.ipynb
.ipynb
10,486
316
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Callbacks\n", "\n", "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/cbouy/mols2grid/blob/master/docs/notebooks/callbacks.ipynb)\n", "\n", "Callbac...
Unknown
2D
cbouy/mols2grid
docs/notebooks/quickstart.ipynb
.ipynb
4,711
175
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Quickstart\n", "\n", "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/cbouy/mols2grid/blob/master/docs/notebooks/quickstart.ipynb)\n", "\n", "The e...
Unknown
2D
cbouy/mols2grid
docs/notebooks/filtering.ipynb
.ipynb
3,481
121
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Filtering\n", "\n", "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/cbouy/mols2grid/blob/master/docs/notebooks/filtering.ipynb)\n", "\n", "It's po...
Unknown
2D
cbouy/mols2grid
scripts/marimo_example.py
.py
2,983
104
import marimo __generated_with = "0.18.4" app = marimo.App(width="medium") @app.cell def import_libraries(): import marimo as mo import mols2grid from mols2grid.datafiles import SOLUBILITY_SDF return SOLUBILITY_SDF, mo, mols2grid @app.cell def prepare(mo): from rdkit.Chem.Draw import rdMolDra...
Python
2D
cbouy/mols2grid
tests/webdriver_utils.py
.py
5,453
137
from ast import literal_eval from base64 import b64decode from io import BytesIO import imagehash from cairosvg import svg2png from PIL import Image from selenium import webdriver from selenium.common.exceptions import StaleElementReferenceException from selenium.webdriver.common.action_chains import ActionChains from...
Python
2D
cbouy/mols2grid
tests/test_select.py
.py
1,528
59
from types import SimpleNamespace import pytest import mols2grid as mg from mols2grid.select import register @pytest.fixture(autouse=True) def clear_register_between_tests(): register._clear() register._init_grid("foo") yield register._clear() def test_clear_register(): register._clear() a...
Python
2D
cbouy/mols2grid
tests/test_marimo_integration.py
.py
4,250
137
import sys from unittest.mock import MagicMock, patch import pandas as pd import pytest from mols2grid import MolGrid from mols2grid.utils import is_running_within_marimo @pytest.fixture def mock_marimo_module(): with patch.dict(sys.modules, {"marimo": MagicMock()}): yield @pytest.mark.usefixtures("mo...
Python
2D
cbouy/mols2grid
tests/__init__.py
.py
0
0
null
Python
2D
cbouy/mols2grid
tests/test_callbacks.py
.py
921
34
import pytest from mols2grid import callbacks def test_make_popup_callback(): popup = callbacks.make_popup_callback( title="${title}", subtitle="${title}", svg="<svg><rect width='10' height='10'/></svg>", html='<span id="foo">${title}</span>', js='var title = "FOOBAR";', ...
Python
2D
cbouy/mols2grid
tests/test_molgrid.py
.py
10,533
345
from types import SimpleNamespace import pytest from numpy.testing import assert_equal from rdkit import Chem from rdkit.Chem import Draw from rdkit.Chem.rdDepictor import Compute2DCoords from mols2grid import MolGrid from mols2grid.select import register def get_grid(df, **kwargs): kwargs.setdefault("mol_col",...
Python
2D
cbouy/mols2grid
tests/test_interface.py
.py
27,392
859
import json import os import sys from base64 import b64encode from datetime import datetime, timezone from pathlib import Path from types import SimpleNamespace import imagehash import pytest from rdkit import Chem from rdkit.Chem import AllChem from selenium import webdriver from selenium.webdriver.common.action_chai...
Python
2D
cbouy/mols2grid
tests/test_utils.py
.py
5,656
205
import gzip from types import SimpleNamespace from unittest.mock import Mock, patch import pandas as pd import pytest from rdkit import Chem from rdkit.Chem.rdDepictor import Compute2DCoords from mols2grid import utils def test_requires(): @utils.requires("_not_a_module") def func(): pass with ...
Python
2D
cbouy/mols2grid
tests/conftest.py
.py
890
46
from pathlib import Path import pytest from mols2grid import MolGrid, datafiles, sdf_to_dataframe @pytest.fixture(scope="module") def sdf_path(): return Path(datafiles.SOLUBILITY_SDF) @pytest.fixture(scope="module") def sdf_file(sdf_path): return str(sdf_path) @pytest.fixture(scope="module") def smiles_...
Python
2D
thesourcerer8/OpenSourceTCAD
install-ubuntu.sh
.sh
220
17
echo Installation routine for Ubuntu: sudo apt-get install docker.io cd Charon sudo bash build.sh cd .. cd Genius sudo bash build.sh cd .. cd DevSim sudo bash build.sh cd .. echo "All Docker images have been built."
Shell
2D
thesourcerer8/OpenSourceTCAD
DevSim/DockerUsage.md
.md
1,028
34
# DevSim TCAD Docker Usage DevSim-TCAD uses a number of old versions of libraries, this makes it increasingly difficult to compile and run on the latest Linux distributions. To work around this a Docker image of an older Ubuntu 20.04 distribution is used. ## Installation ### Docker Installation Search for instruct...
Markdown
2D
thesourcerer8/OpenSourceTCAD
DevSim/build.sh
.sh
30
2
docker build -t devsim-tcad .
Shell
2D
thesourcerer8/OpenSourceTCAD
DevSim/bash.sh
.sh
37
2
docker run -it devsim-tcad /bin/bash
Shell
2D
thesourcerer8/OpenSourceTCAD
Genius/DockerUsage.md
.md
1,028
34
# Genius TCAD Docker Usage Genius-TCAD uses a number of old versions of libraries, this makes it increasingly difficult to compile and run on the latest Linux distributions. To work around this a Docker image of an older Ubuntu 14.04 distribution is used. ## Installation ### Docker Installation Search for instruct...
Markdown
2D
thesourcerer8/OpenSourceTCAD
Genius/build.sh
.sh
30
2
docker build -t genius-tcad .
Shell
2D
thesourcerer8/OpenSourceTCAD
Genius/bash.sh
.sh
160
7
xhost +local: docker run -it \ --env="DISPLAY" \ --env="QT_X11_NO_MITSHM=1" \ --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ genius-tcad /bin/bash
Shell
2D
thesourcerer8/OpenSourceTCAD
Charon/DockerUsage.md
.md
1,028
34
# Charon TCAD Docker Usage Charon-TCAD uses a number of old versions of libraries, this makes it increasingly difficult to compile and run on the latest Linux distributions. To work around this a Docker image of an older Ubuntu 18.04 distribution is used. ## Installation ### Docker Installation Search for instruct...
Markdown
2D
thesourcerer8/OpenSourceTCAD
Charon/build.sh
.sh
30
2
docker build -t charon-tcad .
Shell
2D
thesourcerer8/OpenSourceTCAD
Charon/bash.sh
.sh
37
2
docker run -it charon-tcad /bin/bash
Shell
2D
thesourcerer8/OpenSourceTCAD
Vienna/DockerUsage.md
.md
1,025
34
# Vienna TCAD Docker Usage Vienna-* uses a number of old versions of libraries, this makes it increasingly difficult to compile and run on the latest Linux distributions. To work around this a Docker image of an older Ubuntu 18.04 distribution is used. ## Installation ### Docker Installation Search for instruction...
Markdown
2D
thesourcerer8/OpenSourceTCAD
Vienna/build.sh
.sh
30
2
docker build -t vienna-tcad .
Shell
2D
thesourcerer8/OpenSourceTCAD
Vienna/bash.sh
.sh
37
2
docker run -it vienna-tcad /bin/bash
Shell
2D
brownjm/gpe
spectral.py
.py
3,694
137
"""Spectral method for evolving GPE for BEC's""" from numpy import exp, pi, arange, meshgrid, sqrt, linspace from numpy.fft import fft2, ifft2, fftshift import matplotlib import matplotlib.pyplot as plt from matplotlib import animation matplotlib.rcParams['figure.dpi'] = 200 from timestep2d import QHO class Simula...
Python
2D
brownjm/gpe
timestep2d.py
.py
10,691
374
"""Modified Visscher's method for Gross-Pitaevskii equation for BEC's Original paper: A fast explicit algorithm for the time-dependent Schroedinger equation P. B. Visscher Computers in Physics 5, 596 (1991) doi: 10.1063/1.168415 """ from math import factorial from numpy import pi, sqrt, exp, linspace, meshgrid, zeros...
Python
2D
brownjm/gpe
timestep.py
.py
7,844
287
"""Modified Visscher's method for Gross-Pitaevskii equation for BEC's Original paper: A fast explicit algorithm for the time-dependent Schroedinger equation P. B. Visscher Computers in Physics 5, 596 (1991) doi: 10.1063/1.168415 """ from math import factorial from numpy import pi, sqrt, exp, linspace, zeros, empty, c...
Python
2D
ma-compbio/SNIPER
sniper_train.py
.py
438
23
""" Main training file Calls helper functions from utilities """ import numpy as np import sys from scipy.io import loadmat from utilities.input import get_params from pipeline.training import train_with_hic, train_with_mat if __name__ == '__main__': params = get_params() rowMap = params['cropMap']['rowMap'] co...
Python
2D
ma-compbio/SNIPER
sniper.py
.py
378
20
""" Application file Calls helper functions from utilities """ import numpy as np import sys from scipy.io import loadmat from utilities.input import get_application_params from pipeline.application import apply_on_hic, apply_on_mat if __name__ == '__main__': params = get_application_params() if not params['usem...
Python
2D
ma-compbio/SNIPER
utilities/interchromosome_matrix.py
.py
1,608
69
import os import numpy as np import pandas as pd import pickle as pkl from scipy.sparse import coo_matrix, hstack, vstack from scipy.io import savemat from utilities.data_processing import chrom_sizes def construct(hic_dir='.',prefix='hic',hic_res=100000,sizes_file='data/hg19.chrom.sizes',verbose=False): fullSM = No...
Python
2D
ma-compbio/SNIPER
utilities/input.py
.py
3,474
138
import sys from scipy.io import loadmat def get_params(): # set defaults if len(sys.argv) < 4: raise Exception('Must specify input and target .hic or .mat files and a label file') params = { 'usemat' : False, 'input_file': sys.argv[1], 'target_file': sys.argv[2], 'label_file': sys.argv[3], } if para...
Python
2D
ma-compbio/SNIPER
utilities/data_processing.py
.py
4,488
158
import os import numpy as np from subprocess import call from scipy.io import loadmat, savemat def chrom_sizes(f,length=np.inf): data = open(f,'r') sizes = {} for line in data: ldata = line.split() if len(ldata[0]) > length: continue size...
Python
2D
ma-compbio/SNIPER
pipeline/training.py
.py
4,102
112
import os import tensorflow as tf os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from scipy.io import loadmat from utilities.data_processing import hicToMat, trimMat, contactProbabilities, bootstrap, Sigmoid from pipeline.models import DenoisingAutoencoder, Classifier from keras.utils import to_categorical def trainNN(in...
Python
2D
ma-compbio/SNIPER
pipeline/models.py
.py
1,563
51
import keras.backend as K from keras.layers import Dense, Input, Dropout from keras.models import Sequential, Model def DenoisingAutoencoder(input,target): Ninput = input.shape[1] Noutput = target.shape[1] hidden_dims = [1024,512,256] latent_dim = 128 encodeInput = Input(shape=(Ninput,)) encodeModel = Sequentia...
Python
2D
ma-compbio/SNIPER
pipeline/application.py
.py
2,092
61
import os import tensorflow as tf os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from scipy.io import loadmat, savemat from keras.models import load_model from utilities.data_processing import hicToMat, trimMat, contactProbabilities, Sigmoid, predictionsToBed def apply_on_hic(params): inputM = hicToMat(params['input_file...
Python
2D
ITV-Stuttgart/loadBalancedChemistryModel
PrepareOpenFOAM.sh
.sh
731
18
#!/bin/bash cd ${0%/*} || exit 1 # run from this directory cat << EOF The TDACChemistryModel of OpenFOAM uses a private scope for the variables and member functions. This however prevents other classes, such as the LoadBalancedTDACChemistryModel to derive from this class without replicating all functionality. Furt...
Shell
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/chemistrySolver/makeLoadBalancedChemistrySolvers.C
.C
5,418
227
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/chemistrySolver/makeLoadBalancedChemistrySolverTypes.H
.H
6,270
107
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
Unknown
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/chemistryModel/LoadBalancedTDACChemistryModel/LoadBalancedTDACChemistryModel.C
.C
31,732
1,081
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/chemistryModel/LoadBalancedTDACChemistryModel/LoadBalancedTDACChemistryModel.H
.H
9,233
290
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
Unknown
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/chemistryModel/LoadBalancedTDACChemistryModel/makeLoadBalancedTDACChemistryModels.C
.C
6,255
276
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/chemistryModel/LoadBalancedChemistryModel/LoadBalancedChemistryModel.C
.C
20,786
733
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/chemistryModel/LoadBalancedChemistryModel/makeLoadBalancedChemistryModels.C
.C
6,123
276
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/chemistryModel/LoadBalancedChemistryModel/LoadBalancedChemistryModel.H
.H
8,189
259
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
Unknown
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/pointToPointBuffer/pointToPointBuffer.C
.C
7,605
270
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/pointToPointBuffer/pointToPointBuffer.H
.H
4,877
158
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
Unknown
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/dataContainer/baseDataContainer/baseDataContainer.H
.H
6,280
220
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
Unknown
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/dataContainer/baseDataContainer/baseDataContainer.C
.C
2,683
100
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/dataContainer/TDACDataContainer/TDACDataContainer.H
.H
7,136
246
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
Unknown
2D
ITV-Stuttgart/loadBalancedChemistryModel
src/dataContainer/TDACDataContainer/TDACDataContainer.C
.C
2,826
105
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
tests/src/main.C
.C
4,013
117
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
tests/src/TDACChemistryModel-Test.C
.C
3,508
105
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
tests/src/pointToPointBuffer-Test.C
.C
7,551
293
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
tests/src/standardChemistryModel-Test.C
.C
3,507
105
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
C
2D
ITV-Stuttgart/loadBalancedChemistryModel
tests/src/globalFoamArgs.H
.H
1,757
58
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
Unknown
2D
abhinavroy1999/grain-growth-phase-field-code
GrainGrowth.m
.m
12,068
256
function GrainGrowth(Nx, Ny, dx, dy, end_time, time_step) % Phase-field simulation code for grain growth in 2D, using the Allen-Cahn % equation (for non-conserved order parameters). % % The model is developed by Fan & Chen (http://www.mmm.psu.edu/DNFan1997Actamater_Graingrowth1phase2D.pdf) % % Function ca...
MATLAB
2D
pyNLSE/bpm
1D.py
.py
4,478
155
import numpy as np import matplotlib.pyplot as plt import os from matplotlib import cm import shutil import platform def grid(Nx,Ny,xmax,ymax): x = np.linspace(-xmax, xmax-2*xmax/Nx, Nx) # x variable y = 0 # not used, but a value must be given return x,y; # Builds the Laplacian in Fourier spac...
Python
2D
pyNLSE/bpm
bpm.py
.py
3,154
71
# Integrating a 1+1D or 1+2D NLSE with different initial conditions and for different potentials. # To run this code type the command: # python3 bpm.py example 1D for a 1D example (1D.py file needed) # python3 bpm.py example 2D for a 2D example (2D.py file needed) # where example.py contains the details for...
Python
2D
pyNLSE/bpm
2D.py
.py
6,458
211
import numpy as np import matplotlib.pyplot as plt import os from matplotlib import cm import shutil import platform # Builds the (x,y) grid def grid(Nx,Ny,xmax,ymax): x = np.linspace(-xmax, xmax-2*xmax/Nx, Nx) # x variable y = np.linspace(-ymax, ymax-2*ymax/Ny, Ny) # y variable y,x=np.meshgrid(y, x) retu...
Python
2D
pyNLSE/bpm
examples2D/Diffraction_Circle_2D.py
.py
926
36
# File: ./examples2D/Diffraction_Circle_2D.py # Run as python3 bpm.py Diffraction_Circle_2D 2D # Diffraction by a circular aperture import numpy as np Nx = 500 # Grid points Ny = Nx dt = 0.001 # Evolution step tmax = 60 # End of propagation xmax = 100 # x-window size ymax = xmax # y-window s...
Python
2D
pyNLSE/bpm
examples2D/Vortex_Precession_2D.py
.py
1,012
36
# File: ./examples2D/Vortex_Precession_2D.py # Run as python3 bpm.py Vortex_Precession_2D 2D # Vortex precession within a harmonic potential import numpy as np Nx = 300 # Grid points Ny = Nx dt = 0.001 # Evolution step tmax = 80 # End of propagation xmax = 8 # x-window size ymax = xma...
Python
2D
pyNLSE/bpm
examples2D/Vortices_Pattern_2D.py
.py
1,678
51
# File: ./examples2D/Vortices_Pattern_2D.py # Run as python3 bpm.py Vortices_Pattern_2D 2D # A Gaussian beam impinges on a mask that generates a diffaction pattern with # vortices of different topological charges. # NOTICE: This example uses a fine computational grid, it uses a lot of memory # and takes some time...
Python
2D
pyNLSE/bpm
examples2D/Vortex_2D.py
.py
1,146
37
# File: ./examples2D/Vortex_2D.py # Run as python3 bpm.py Vortex_2D 2D # A vortex beam propagating in free space import numpy as np Nx = 300 # Grid points Ny = Nx dt = 0.001 # Evolution step tmax = 10 # End of propagation xmax = 20 # x-window size ymax = xmax # y-window...
Python
2D
pyNLSE/bpm
examples2D/Vortex_Breaking_2D.py
.py
1,182
37
# File: ./examples2D/Vortex_Breaking_2D.py # Run as python3 bpm.py Vortex_Breaking_2D 2D # Azimuthal instability of a vortex because of an attractive nonlinearity import numpy as np Nx = 300 # Grid points Ny = Nx dt = 0.001 # Evolution step tmax = 500 # End of propagation xmax = 120 # x-...
Python
2D
pyNLSE/bpm
examples2D/Collapse_2D.py
.py
1,527
52
# File: ./examples2D/Collapse_2D.py # Run as python3 bpm.py Collapse_2D 2D # Self-similar collapse of the Townes' profile import numpy as np Nx = 500 # Grid points Ny = 500 dt = 0.005 # Evolution step tmax = 7 # End of propagation xmax = 20 # x-window size ymax = xmax # y-window size ...
Python
2D
pyNLSE/bpm
examples2D/Liquid_Droplet_2D.py
.py
1,370
50
# File: ./examples2D/Liquid_Droplet_2D.py # Run as python3 bpm.py Liquid_Droplet_2D 2D # A droplet of "liquid light" collides with a barrier import numpy as np Nx = 400 # Grid points Ny = 240 dt = 0.001 # Evolution step tmax = 140 # End of propagation xmax = 160 # x-window size ymax = 10...
Python
2D
pyNLSE/bpm
examples2D/Gaussian_Vortex_interf_2D.py
.py
1,608
57
# File: ./examples2D/Gaussian_Vortex_interf_2D.py # Run as python3 bpm.py Gaussian_Vortex_interf_2D 2D # A Gaussian beam and a vortex cross each other generating the typical fork-like # pattern import numpy as np Nx = 600 # Grid points Ny = 300 dt = 0.001 # Evolution step tmax = 7 # End of ...
Python
2D
pyNLSE/bpm
examples2D/Gaussian_Beam_2D.py
.py
1,082
34
# File: ./examples2D/Gaussian_Beam_2D.py # Run as python3 bpm.py Gaussian_Beam_2D 2D # A Gaussian beam propagating in free space import numpy as np Nx = 300 # Grid points Ny = Nx dt = 0.001 # Evolution step tmax = 10 # End of propagation xmax = 20 # x-window size ymax = xmax # y-win...
Python
2D
pyNLSE/bpm
examples2D/Filamentation_2D.py
.py
1,319
39
# File: ./examples2D/Filamentation.py # Run as python3 bpm.py Filamentation 2D # Filamentation: an initially constant energy distribution results in the # formation of filaments. The nonlinearities drive the evolution. import numpy as np Nx = 400 # Grid points Ny = Nx dt = 0.001 # Evolution step tmax = ...
Python
2D
pyNLSE/bpm
examples1D/Thomas_Fermi_1D.py
.py
1,428
49
# File: ./examples1D/Thomas_Fermi_1D.py # Run as python3 bpm.py Thomas_Fermi_1D 1D # Initially, a nonlinear wave packet is confined within a harmonic well, and # it is well approximated by a Thomas-Fermi profile (in which the Laplacian # is neglected). At t=5, the strength of the nonlinearity is changed and an # osc...
Python
2D
pyNLSE/bpm
examples1D/Diffraction_Slit_1D.py
.py
1,139
34
# File: ./examples1D/Diffraction_Slit_1D.py # Run as python3 bpm.py Diffraction_Slit_1D 1D # Diffraction by a slit # The initial condition is a flat function within a finite domain, modeling # the passage of a wide wave through a slit. The evolution generates the typical # diffraction pattern import numpy as np Nx...
Python
2D
pyNLSE/bpm
examples1D/Solitons_phase_opp_1D.py
.py
1,276
42
# File: ./examples1D/Solitons_phase_opp_1D.py # Run as python3 bpm.py Solitons_phase_opp_1D 1D # Encounter of two solitons in phase opposition. The process can be interpreted # as two robust wave packets that bounce back from each other. import numpy as np Nx = 500 # Grid points Ny = Nx dt = 0.001 # Evo...
Python
2D
pyNLSE/bpm
examples1D/Soliton_Emission_B_1D.py
.py
1,656
48
# File: ./examples1D/Soliton_Emission_B_1D.py # Run as python3 bpm.py Soliton_Emission_B_1D 1D # Initially, a Gaussian wave packet is confined within a shallow trap. At a given # time, a repulsive interaction is turned on and the wave starts expanding. Then, # the sign of the nonlinear term is changed and the intera...
Python
2D
pyNLSE/bpm
examples1D/Interference_Gaussians_1D.py
.py
1,243
35
# File: ./examples1D/Interference_Gaussians_1D.py # Run as python3 bpm.py Interference_Gaussians_1D 1D # Interference of two Gaussian wave packets. # The initial condition consists of two separate Gaussians. Each of them grows # wider because of diffraction due to the Laplacian term. Eventually, they are # wide eno...
Python
2D
pyNLSE/bpm
examples1D/Double_Well_1D.py
.py
1,132
34
# File: ./examples1D/Double_Well_1D.py # Run as python3 bpm.py Double_Well_1D 1D # Beating in a double well potential # A double well potential is defined. The initial condition concentrates the # wavefunction around one of the minima. The simulation shows that, periodically, the # energy tunnels between the two wel...
Python
2D
pyNLSE/bpm
examples1D/Solitons_in_phase_1D.py
.py
1,237
41
# File: ./examples1D/Solitons_in_phase_1D.py # Run as python3 bpm.py Solitons_in_phase_1D 1D # Encounter of two solitons in phase, which traverse each other unaffected. # During the collision, an interference pattern is generated. import numpy as np Nx = 500 # Grid points Ny = Nx dt = 0.001 # Evolution s...
Python
2D
pyNLSE/bpm
examples1D/Sech2_Pot_1D.py
.py
1,372
37
# File: ./examples1D/Sech2_Pot_1D.py # Run as python3 bpm.py Sech2_Pot_1D 1D # A Gaussian wave packet traverses a reflectionless potential. The simulation # non-trivially shows that there is no reflected energy. Try changing the value # of s to different (integer and non-integer) values import numpy as np Nx = 2...
Python
2D
pyNLSE/bpm
examples1D/Soliton_Emission_A_1D.py
.py
1,300
38
# File: ./examples1D/Soliton_Emission_A_1D.py # Run as python3 bpm.py Soliton_Emission_A_1D 1D # Initially, there is a Gaussian wavefunction within a shallow trap. # Due to a space-dependent attractive nonlineary, the energy moves rightwards # and it turns out that a train of solitons is emitted. import numpy as ...
Python
2D
pyNLSE/bpm
examples1D/Rectangular_Barrier_1D.py
.py
1,234
36
# File: ./examples1D/Rectangular_Barrier_1D.py # Run as python3 bpm.py Rectangular_Barrier_1D 1D # A Gaussian wave packet impinges on a rectangular barrier. Part of the wave # is reflected, part of the wave is transmitted. import numpy as np Nx = 1600 # Grid points Ny = Nx dt = 0.0001 # Evolution step t...
Python
2D
pillowlab/GLMspiketools
setpaths_GLMspiketools.m
.m
600
19
% SETPATHS.m - GLMspiketools code repository % % This simple script sets the path to include relevant directories for the % GLMspiketools code package. You must 'cd' into this directory in order % to evaluate it. % % More info: http://pillowlab.princeton.edu/code_GLM.html % Github page: https://github.com/pillowlab/GL...
MATLAB
2D
pillowlab/GLMspiketools
glmtools_spline/mksplineDesignMat.m
.m
2,179
71
function [Xdesign,Ysrt,Mspline] = mksplineDesignMat(X,Y,ss,sortflag,dcflag) % [Xdesign,Ysrt,Mspline] = mksplineDesignMat(X,Y,ss,sortflag) % % Computes design matrix for least-squares fitting cubic splines, so that % the problem can be written: % argmin_w ||Ysrt - Xdesign*w||^2 % % "Standard" spline coefficients ...
MATLAB
2D
pillowlab/GLMspiketools
glmtools_spline/mksplineParamMtx.m
.m
3,300
85
function Mspline = mksplineParamMtx(ss,dcflag) % Mspline = mksplineParamMtx(ss,dcflag) % % Computes matrix parametrizing a cubic spline (3rd order piecewise % polynomial) with given smoothness and end-point conditions % % Inputs: % ss - spline struct with fields "breaks", "smoothness", and "extrapDeg" % field...
MATLAB
2D
pillowlab/GLMspiketools
glmtools_spline/ppfun.m
.m
1,481
59
function [f,df,ddf]=ppfun(pp,xx) % [f,df,ddf]=ppfun(pp,xx) % % Evaluate piecewise polynomial 'pp' at values 'xx'. Optionally returns first and % second derivs at these points. % % Inputs: % pp = piecewise polynomial structure, given (eg) by makepp or spline % xx = vector of values at which to ev...
MATLAB
2D
pillowlab/GLMspiketools
glmtools_spline/MLfit_GLMwithspline.m
.m
1,684
55
function [gg,neglogli,H] = MLfit_GLMwithspline(gg,Stim,optimargs,npasses) % [gg,neglogli,H] = MLfit_GLMwithspline(gg,Stim,optimargs,npasses) % % Fit GLM filters and spline nonlinearity using alternating % ascent of filter and spline parameters % % Inputs: % gg = glm param structure % Stim = stimulus % optima...
MATLAB