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

Refactoring to prepare for new distribution function approach #76

Merged
merged 61 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
cb414c0
refactoring parameter types and the forward call for form factor
joglekara Nov 30, 2024
a8372d2
renaming and reorganization
joglekara Nov 30, 2024
e2cc125
enabling forward pass with 1D. needed calibration information
joglekara Dec 1, 2024
71815bd
making the electron parameter dict explicitly named electron
joglekara Dec 2, 2024
8888fc4
passing 2/3 tests
joglekara Dec 2, 2024
e4bbdff
more cleanup
joglekara Dec 2, 2024
3fe7489
still needs a real part for some reason!
joglekara Dec 2, 2024
32e9771
no longer always initializing f, only if in "arbitrary" mode
joglekara Dec 2, 2024
c11b450
working forward passes for 1D and 2D distribution functions
joglekara Dec 5, 2024
06f33f7
new rotation function using einsum
joglekara Dec 5, 2024
86467d8
debugging arts 1d fit
joglekara Dec 9, 2024
35c1a44
working 2d forward pass
joglekara Dec 10, 2024
d7c2069
renamed TSFitter to ThomsonScattering
joglekara Dec 10, 2024
3ab0f12
renaming to loss function
joglekara Dec 11, 2024
b557c4f
everything related to weights is inside the thomson diagnostic now. l…
joglekara Dec 11, 2024
2c7ef44
some refactoring for forward pass
joglekara Dec 11, 2024
8387a45
commenting the sharding code
joglekara Dec 11, 2024
18db2b8
working forward pass with equinox modules but gradients have nans
joglekara Dec 12, 2024
114c143
passing 1d tests!
joglekara Dec 12, 2024
3a84606
working but possibly incorrect arts1d forward pass
joglekara Dec 12, 2024
0df9be8
updated inputs
joglekara Dec 12, 2024
8042980
needs more resolution turns out
joglekara Dec 12, 2024
878b031
moved code around
joglekara Dec 12, 2024
fe557a1
more cleanup
joglekara Dec 12, 2024
8b002a7
cleaned up form factor API
joglekara Dec 13, 2024
95c09d8
cleanup
joglekara Dec 13, 2024
c1c89ff
forward pass tests
joglekara Dec 14, 2024
2ec1df8
inverse 1d test
joglekara Dec 15, 2024
3766fbc
inverse 1d test
joglekara Dec 15, 2024
9f2c3c1
arts1d test
joglekara Dec 15, 2024
e853dfc
arts1d test
joglekara Dec 15, 2024
327337c
working inverse arts1d for parameters but not full f
joglekara Dec 16, 2024
0171651
working arts 1d test
joglekara Dec 17, 2024
0347ddb
comparing params in 1d test now
joglekara Dec 17, 2024
a8da926
arbitrary1D
joglekara Dec 18, 2024
0ffdb12
mamba github action test
joglekara Dec 19, 2024
ac712ce
mamba debug
joglekara Dec 19, 2024
c301ccb
conda env
joglekara Dec 19, 2024
0535fff
test
joglekara Dec 19, 2024
43dcdb1
actions test
joglekara Dec 19, 2024
a209138
gpu runner
joglekara Dec 19, 2024
2d8cf7b
gpu test
joglekara Dec 19, 2024
e8be7b6
sharding for 2d formfactor, also an arbitrary1d nn implementation tha…
joglekara Dec 21, 2024
081e80c
stuck calibration and scattering angles inside ThomsonDiagnostic
joglekara Dec 21, 2024
d436b8b
Revert "stuck calibration and scattering angles inside ThomsonDiagnos…
joglekara Dec 21, 2024
5589a6a
removed old input 1d and dist func code. timing tests and compilation…
joglekara Dec 23, 2024
d8b8675
1d random inverse test
joglekara Dec 23, 2024
3b2d23c
passing tests
joglekara Dec 23, 2024
cfb2eb5
no export
joglekara Dec 23, 2024
7f9f9b2
dont need CPU only env var
joglekara Dec 23, 2024
5b16095
deleting file
joglekara Dec 24, 2024
7b08859
Merge branch 'refactor/dist-funcs' of github.com:ergodicio/inverse-th…
joglekara Dec 24, 2024
867ddbb
no longer always loading pyhdf
joglekara Jan 6, 2025
4ff4d58
Merge branch 'refactor/dist-funcs' of github.com:ergodicio/tsadar int…
joglekara Jan 6, 2025
80cbe43
reqs
joglekara Jan 6, 2025
e2749a7
init file
joglekara Jan 6, 2025
177f1fa
exposing `get_scattering_angles`
joglekara Jan 6, 2025
a744300
setup.py
joglekara Jan 6, 2025
f36891d
exposing `ThomsonParams`
joglekara Jan 7, 2025
b5cb0b7
thought i got rid of these
joglekara Jan 7, 2025
464389a
removed
joglekara Jan 7, 2025
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
72 changes: 50 additions & 22 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,69 @@
# This is a basic workflow to help you get started with Actions

name: test
name: cpu-tests

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
pull_request:
branches:
- main
types:
- opened
- synchronize
- ready_for_review


# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-its:

test-tsadar-cpu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.11
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: tsadar-cpu
environment-file: env.yml
- shell: bash -el {0}
run: |
pytest tests/

test-tsadar-gpu:
runs-on: "gpu_runner"
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.11
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: tsadar-gpu
environment-file: env_gpu.yml
- shell: bash -el {0}
run: |
pytest tests/


# - shell: bash -el {0}
# run: mamba env create -f env.yml
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python 3.11
# uses: actions/setup-python@v2
# with:
# python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade black
python -m pip install --upgrade pytest wheel
python -m pip install --upgrade -r requirements.txt
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install --upgrade black
# python -m pip install --upgrade pytest wheel
# # python -m pip install --upgrade -r requirements.txt

- name: Test with pytest
run: |
pytest tests/
# - name: Test with pytest
# run: |
# python -m pip install pytest
# CPU_ONLY=True pytest tests/
43 changes: 10 additions & 33 deletions configs/1d/defaults.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
parameters:
species1:
type:
electron:
electron:
Te:
val: .6
active: False
Expand All @@ -12,31 +10,8 @@ parameters:
active: False
lb: 0.001
ub: 1.0
m:
val: 3.0
active: False
lb: 2.0
ub: 5.0
matte: False
fe:
val: [ ]
active: False
length: 3999
type:
DLM:
lb: -100.
ub: -0.5
fe_decrease_strict: False
symmetric: False
dim: 1
v_res: 0.1
temp_asym: 1.0
m_theta: 0.0
m_asym: 1.

species2:
type:
ion:
ion-1:
Ti:
val: 0.12
active: False
Expand All @@ -56,8 +31,6 @@ parameters:
active: False

general:
type:
general:
amp1:
val: 1.
active: False
Expand Down Expand Up @@ -106,7 +79,8 @@ parameters:
other:
expandedions: False
extraoptions:
load_ion_spec: False
spectype: 1d
load_ion_spec: false
load_ele_spec: True
fit_IAW: False
fit_EPWb: True
Expand All @@ -115,6 +89,9 @@ other:
PhysParams:
background: [0, 0]
norm: 0
widIRF:
spect_stddev_ele: 1.3
spect_stddev_ion: 0.015
iawoff: 0
iawfilter: [1, 4, 24, 528]
CCDsize: [1024, 1024]
Expand Down Expand Up @@ -158,7 +135,7 @@ data:
pixel
start: 400
end: 600
skip: 10
skip: 50
background:
type:
pixel
Expand Down Expand Up @@ -186,7 +163,7 @@ optimizer:
x_norm: False
grad_method: AD
batch_size: 2
num_epochs: 1000
num_epochs: 120
learning_rate: 1.0e-2
parameter_norm: True
refine_factor: 0
Expand All @@ -204,4 +181,4 @@ dist_fit:

mlflow:
experiment: inverse-thomson-scattering
run: base
run: new
39 changes: 13 additions & 26 deletions configs/1d/inputs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
parameters:
species1:
type:
electron:
active: False
electron:
Te:
val: .5
active: True
Expand All @@ -13,30 +10,23 @@ parameters:
active: True
lb: .001
ub: 1.
m:
val: 3.0
active: True
lb: 2.
ub: 5.
fe:
val: [ ]
active: False
length: 3999
type:
DLM:
lb: -100.
ub: -0.5
active: True
type: dlm
dim: 1
v_res: 0.1
species2:
type:
ion:
active: False
nv: 64
params:
m:
val: 2.5
lb: 2.0
ub: 5.0
ion-1:
Ti:
val: .2
active: False
lb: 0.01
ub: 3.
same: False
Z:
val: 8.
active: False
Expand All @@ -46,12 +36,9 @@ parameters:
val: 40.
active: False
fract:
val: 1.0
val: 1.
active: False
general:
type:
general:
active: False
amp1:
val: 1.
active: True
Expand Down Expand Up @@ -101,5 +88,5 @@ parameters:
other:
refit: False
refit_thresh: 5.0
calc_sigmas: True
calc_sigmas: false

Loading
Loading