core icon indicating copy to clipboard operation
core copied to clipboard

Move the line shape models to a submodule

Open vsnever opened this issue 2 years ago • 1 comments

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 avatar Jan 03 '23 15:01 vsnever

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.

jacklovell avatar Jan 03 '23 15:01 jacklovell

Implemented in #400.

vsnever avatar Aug 02 '24 10:08 vsnever