Skip to content

added the prepareLasyLaser module to the python utilities - #5623

Open
Ehtyar wants to merge 12 commits into
ComputationalRadiationPhysics:devfrom
Ehtyar:topic-lasyLaser
Open

added the prepareLasyLaser module to the python utilities#5623
Ehtyar wants to merge 12 commits into
ComputationalRadiationPhysics:devfrom
Ehtyar:topic-lasyLaser

Conversation

@Ehtyar

@Ehtyar Ehtyar commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

prepareLasyLaser is a python module with which it is possible to write openPMD-compatible files from Lasy laser objects, that the FromOpenPMDPulse incident field method in PIConGPU can read. prepareLasyLaser_example.ipynb provides an example of how to use it. I also added a line in the relevant docs document.

@chillenzer chillenzer added the CI:no-compile CI is skipping compile/runtime tests but runs PICMI tests label Feb 4, 2026
@chillenzer chillenzer added the component: tools scripts, python libs and CMake label Feb 4, 2026
@chillenzer chillenzer added this to the 0.9.0 / next stable milestone Feb 4, 2026
@Ehtyar

Ehtyar commented Feb 17, 2026

Copy link
Copy Markdown
Contributor Author

Wow, soething went wrong. I did not intend for this to happen like that.

@PrometheusPi

PrometheusPi commented Feb 18, 2026

Copy link
Copy Markdown
Member

@Ehtyar The CI created changed on your PR. Please see log. It also tells you how to fix your code.
It looks like it's just a formatting issue.

@Ehtyar
Ehtyar force-pushed the topic-lasyLaser branch 2 times, most recently from 685b9f8 to c5c10ae Compare February 19, 2026 11:35
@PrometheusPi

Copy link
Copy Markdown
Member

@steindev @Ehtyar What is the plan for this PR?

@Ehtyar

Ehtyar commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

@PrometheusPi The plan is to push it to mainline, as soon as it is good enough for it.

@Ehtyar

Ehtyar commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Please review now. I have fixed the bugs and added a test suite for this module.

@PrometheusPi

Copy link
Copy Markdown
Member

@Ehtyar There is still a previous review of your code from me pending that has not yet been included (manly question and typos). Could you incorporate these suggestions before a have another look at it please?

@PrometheusPi PrometheusPi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry @Ehtyar I never pushed my suggesting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psychocoderHPC @ikbuibui What are current rules on adding *.ipynbfiles?

Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
@Ehtyar
Ehtyar force-pushed the topic-lasyLaser branch from 0134809 to 41ddfb7 Compare July 30, 2026 08:55
Ehtyar added 7 commits August 4, 2026 12:56
prepareLasyLaser is a python module with which it is possible to write openPMD-compatible files from Lasy laser objects, that the FromOpenPMDPulse incident field method in PIConGPU can read. prepareLasyLaser_example.ipynb provides an example of how to use it.
I also added a line in the relevant docs document.
Because the __init__.py in the directory lib/python/picongpu/extra/input/ was empty, the modules there were not available in the picongpu python package. Now they are properly imported. For this, lasy was added to the package dependencies.
…lso moved the test suite for it to the test folder and fixed it as well.
Comment thread lib/python/test/picongpu/quick/extra/input/test_prepareLasyLaser.py Outdated
return dV[:, None]


def normalize_energy(dim, field, energy, Nt=None):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this function called normalize - doesn't it rescale to a given energy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats fair, I just followed the naming of the Lasy function for the same purpose.
What would be a better name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this better, scale_to_energy?

Comment thread lib/python/test/picongpu/quick/extra/input/test_prepareLasyLaser.py
Comment thread lib/python/test/picongpu/quick/extra/input/test_prepareLasyLaser.py Outdated
Comment thread lib/python/test/picongpu/quick/extra/input/test_prepareLasyLaser.py Outdated
Comment thread lib/python/test/picongpu/quick/extra/input/test_prepareLasyLaser.py Outdated
Comment thread lib/python/test/picongpu/quick/extra/input/test_prepareLasyLaser.py Outdated
Comment thread lib/python/test/picongpu/quick/extra/input/test_prepareLasyLaser.py Outdated
Comment thread lib/python/test/picongpu/quick/extra/input/test_prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
if tqdm_available:
pbar.update(1)
else:
if ix % 20 == 19:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you use this strange module check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, tqdm is not currently a dependency of the picongpu package. I can add it to the dependencies, but it is not really necessary, it just makes it prettier. That is why I also added the option to just use print.

Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Comment thread lib/python/picongpu/extra/input/prepareLasyLaser.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:no-compile CI is skipping compile/runtime tests but runs PICMI tests component: tools scripts, python libs and CMake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants