Skip to content

Vibronic spectroscopy post-processing tools#4581

Merged
oschuett merged 27 commits intocp2k:masterfrom
BelizSertcan:vibspec
Dec 10, 2025
Merged

Vibronic spectroscopy post-processing tools#4581
oschuett merged 27 commits intocp2k:masterfrom
BelizSertcan:vibspec

Conversation

@BelizSertcan
Copy link
Member

No description provided.

@BelizSertcan BelizSertcan marked this pull request as draft December 2, 2025 16:53
@oschuett
Copy link
Member

oschuett commented Dec 3, 2025

Nice work!

Since we don't have a lot of Python code, we usually just test it in test_misc.sh.

As a test, maybe you could add a folder with a complete example and run your script on that?

As an additional safety net, you could add Python type hints and have them checked with mypy --strict.

And finally, would it make sense to add a short comparison between your method and surface hopping to guide the user?

@BelizSertcan
Copy link
Member Author

Hi @oschuett

Where should I add the complete example? Is vibronic_spec/example a good place?

I have added type hints to the file parsers, should I add to all functions?

Surface hopping tells you about photodynamics whereas this module only gives the static spectral lineshape. Since they answer different questions I don't think it makes sense to compare them.

@oschuett
Copy link
Member

oschuett commented Dec 4, 2025

Where should I add the complete example? Is vibronic_spec/example a good place?

Yes, if the files are less than 1MB in size. Otherwise they should go into https://github.com/cp2k/cp2k-examples.

I have added type hints to the file parsers, should I add to all functions?

Mypy needs type hints on all functions to fully check your code. Therefore --strict enforces this (can be overruled with # type: ignore). Annotating a code usually requires running mypy several times until it's "happy". So, it's best if you install it locally: pip install mypy.

Furthermore, you'll also need to make the main script executable: chmod +x main.py; git add main.py.

And Sphinx complains about non-consecutive header level:

/opt/cp2k/docs/methods/properties/optical/vibronicspec.md:5: WARNING: Non-consecutive header level increase; H2 to H5 [myst.header]
/opt/cp2k/docs/methods/properties/optical/vibronicspec.md:12: WARNING: Non-consecutive header level increase; H2 to H5 [myst.header]
/opt/cp2k/docs/methods/properties/optical/vibronicspec.md:26: WARNING: Non-consecutive header level increase; H2 to H5 [myst.header]
/opt/cp2k/docs/methods/properties/optical/vibronicspec.md:39: WARNING: Non-consecutive header level increase; H2 to H5 [myst.header]
/opt/cp2k/docs/methods/properties/optical/vibronicspec.md:150: WARNING: Non-consecutive header level increase; H2 to H4 [myst.header]
/opt/cp2k/docs/methods/properties/optical/vibronicspec.md:289: WARNING: Non-consecutive header level increase; H2 to H4 [myst.header]
/opt/cp2k/docs/methods/properties/optical/vibronicspec.md:363: WARNING: Non-consecutive header level increase; H2 to H4 [myst.header]

@BelizSertcan BelizSertcan marked this pull request as ready for review December 10, 2025 16:29
@BelizSertcan
Copy link
Member Author

okay it is finally ready.

@oschuett oschuett merged commit 4672866 into cp2k:master Dec 10, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants