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

Move the line shape models to a submodule #396

Open
vsnever opened this issue Jan 3, 2023 · 1 comment · May be fixed by #400
Open

Move the line shape models to a submodule #396

vsnever opened this issue Jan 3, 2023 · 1 comment · May be fixed by #400
Assignees

Comments

@vsnever
Copy link
Member

vsnever commented Jan 3, 2023

The lineshape.pyx already contains almost 1000 lines of code and the implementation of #393 will bloat it even more. I think it's time to create a separate submodule for line shape models. Here is a suggested file structure, with an indication of which class/function goes where. This change will not affect user code.

cherab/core/model/lineshape/
├── beam/
│   ├── __init__.py
│   ├── __init__.pxd
│   ├── base.pyx  <-- BeamLineShapeModel
│   ├── base.pxd
│   ├── mse.pyx  <-- BeamEmissionMultiplet
│   ├── mse.pxd
├── __init__.py
├── __init__.pxd
├── base.pyx  <-- LineShapeModel
├── base.pxd
├── doppler.pyx  <-- doppler_shift, thermal_broadening
├── doppler.pxd
├── gaussian.pyx  <-- add_gaussian_line, GaussianLine
├── gaussian.pxd
├── multiplet.pyx  <-- MultipletLineShape
├── multiplet.pxd
├── stark.pyx  <-- StarkBroadenedLine
├── stark.pxd
├── zeeman.pyx  <-- ZeemanLineShapeModel, ZeemanTriplet, ParametrisedZeemanTriplet, ZeemanMultiplet
├── zeeman.pxd

@jacklovell, @Mateasek, if you agree, I'll make the change along with implementation of #393.

@vsnever vsnever self-assigned this Jan 3, 2023
@jacklovell
Copy link
Member

I think this is a good idea. We already have some unit tests for lineshapes, but it would be good to check when doing this re-factor that the coverage is sufficient. That would give more confidence that the changes won't break anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants