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

Reorganization: interfaces and core functionality #35

Closed
7 tasks done
szabo137 opened this issue Jun 11, 2024 · 6 comments
Closed
7 tasks done

Reorganization: interfaces and core functionality #35

szabo137 opened this issue Jun 11, 2024 · 6 comments
Assignees

Comments

@szabo137
Copy link
Member

szabo137 commented Jun 11, 2024

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

  • move core function to QEDcore, add integration tests to `QEDcore, and merge it to dev (using the replacement above), passing all unit tests and all integration tests. This might require several PRs and registration in the local registry.
  • For all downstream packages: move all QEDbase stuff behind the QEDbase namespace using the replacement above. Add QEDcore as the dependency, where the core functionality now comes from.
  • Update QEDbase by removing core functionality, which is now placed in QEDcore (must not break anything because of 2.) and adding all interfaces from all downstream packages. This must not break the integration tests. Release QEDbase0.2.
  • Update QEDcore by revoking the QEDbase-namespace replacement. Must not break the integration tests. Release QEDcore0.1.
  • Update QEDprocesses.jl by revoking the QEDbase-namespace replacement along with removing the interfaces now in QEDbase. Release QEDprocesses0.2
  • Update QEDevents.jl by revoking the QEDbase-namespace replacement along with removing the interfaces now in QEDbase. Release QEDevents0.1.
  • Update QEDfields.jl by revoking the QEDbase-namespace replacement along with removing the interfaces now in QEDbase. Release QEDfields0.1.

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

@szabo137
Copy link
Member Author

@AntonReinhard @SimeonEhrig what do you think?

@SimeonEhrig
Copy link
Member

Sounds like a working approach

@AntonReinhard
Copy link
Member

First step completed with QEDjl-project/QEDcore.jl#6

AntonReinhard pushed a commit to QEDjl-project/QEDfields.jl that referenced this issue Jun 18, 2024
This opts out the `QEDbase` namespace and adds the dependency on
`QEDcore`.

This is part of the general restructuring of `QED.jl`, see
QEDjl-project/QuantumElectrodynamics.jl#35 for details.

---------

Co-authored-by: Uwe Hernandez Acosta <u.hernandez@hzdr.de>
AntonReinhard pushed a commit to QEDjl-project/QEDprocesses.jl that referenced this issue Jun 19, 2024
This opts out the `QEDbase` namespace and adds the dependency on
`QEDcore`.

This is part of the general restructuring of `QED.jl`, see
QEDjl-project/QuantumElectrodynamics.jl#35 for details.

---------

Co-authored-by: Uwe Hernandez Acosta <u.hernandez@hzdr.de>
szabo137 added a commit to QEDjl-project/QEDcore.jl that referenced this issue Jun 19, 2024
Copied the concrete implementations of `base_state` from `QEDbase.jl`
(see
https://github.com/QEDjl-project/QEDbase.jl/blob/dev/src/particles/particle_states.jl)


This is part of the general restructuring of `QED.jl`, see
QEDjl-project/QuantumElectrodynamics.jl#35 for details.
szabo137 added a commit to QEDjl-project/QEDfields.jl that referenced this issue Jun 20, 2024
With this PR, QEDfields should use `base_state` from QEDcore, not from
QEDbase.

This is part of the general restructuring of `QED.jl`, see
QEDjl-project/QuantumElectrodynamics.jl#35 for details.

---------

Co-authored-by: Uwe Hernandez Acosta <u.hernandez@hzdr.de>
@szabo137
Copy link
Member Author

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

szabo137 added a commit to QEDjl-project/QEDfields.jl that referenced this issue Jun 28, 2024
The namespace shadowing of QEDbase is revoked. This is part of the
restructuring of `QED.jl`. See
QEDjl-project/QuantumElectrodynamics.jl#35 for details.

---------

Co-authored-by: Uwe Hernandez Acosta <u.hernandez@hzdr.de>
@AntonReinhard
Copy link
Member

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

@szabo137
Copy link
Member Author

Thank you very much for your help!
Screenshot 2024-06-28 at 22 22 01

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

No branches or pull requests

3 participants