QEDjl-project / QED.jl

[WIP] QED.jl: A strong-field particle physics framework
MIT License
5 stars 3 forks source link

Reorganization: interfaces and core functionality #35

Closed szabo137 closed 3 weeks ago

szabo137 commented 1 month ago

As we discussed offline, we must reorganize parts of the QEDjl ecosystem. Most importantly, QEDbase.jl must contain all interfaces used in several QED.jl packages. Furthermore, there is a new package QEDcore.jl which contains all the core types and functionality (particles, four-momenta, dirac-tensors, etc). Essentially, we move all concrete implementations from QEDbase.jl to QEDcore.jl and ship all interfaces from the downstream packages to QEDbase.jl.

Some pull requests were already opened to reorganize QEDbase.jl, QEDcore.jl, and QEDprocesses.jl (big thanks to @AntonReinhard). Nevertheless, the procedure of merging is still an open question and seems to be doable, but not straightforward, as discussed offline with @SimeonEhrig.

Here I would like to propose an alternative solution to the follow-the-integration-test errors.

Suggested solution

Preparation

Assume, we have a working version of QEDcore.jl (say QEDcore0.1), depending on the old version of QEDbase.jl (say QEDbase0.1). This is possible by replacing

using QEDbase -> import QEDbase
AbstractType -> QEDbase.AbstractType
interface_function -> QEDbase.interface_function

where AbstractType and interface_function stand for the root types and interface functions of all interfaces.

Similarly, in the downstream packages, one can put QEDbase0.1 beside QEDcore0.1 without breaking the unit tests, by using again import QEDbase, QEDbase.AbstractType, and QEDbase.interface_function instead of using QEDbase. In this case, using using QEDcore will not break the tests, because the breaking redefinitions still are in the QEDbase namespace.

At this point, one can easily include the integration tests to QEDcore.jl without breaking anything.

Updates

Now we can update QEDbase.jl by removing the core functions (now provided by QEDcore0.1) and merge the new version (say QEDbase0.2) to dev. This must not break the integration tests, because all downstream packages only depend on exported types and interface functions, the core functions are already coming from QEDcore. Therefore, one can release QEDbase0.2.

Since QEDbase0.2 is now in place, we can update all the downstream packages (including QEDcore0.1) can be updated by bumping the version of QEDbase.jl, removing the interfaces now in QEDbase and revoking the replacement

import QEDbase -> using QEDbase
QEDbase.AbstractType -> AbstractType
QEDbase.interface_function -> interface_function

Proposed schedule

Afterwards, all packages are released using the new structure and all integration tests should pass.

szabo137 commented 1 month ago

@AntonReinhard @SimeonEhrig what do you think?

SimeonEhrig commented 1 month ago

Sounds like a working approach

AntonReinhard commented 1 month ago

First step completed with https://github.com/QEDjl-project/QEDcore.jl/pull/6

szabo137 commented 3 weeks ago

@AntonReinhard Seems like we've done it. Is there anything left over, except releasing?

AntonReinhard commented 3 weeks ago

Yes I think we're done except for all the releases

szabo137 commented 3 weeks ago

Thank you very much for your help!

Screenshot 2024-06-28 at 22 22 01