Skip to content

Conversation

@GiovanniCanali
Copy link
Collaborator

Description

This PR fixes #734

Checklist

  • Code follows the project’s Code Style Guidelines
  • Tests have been added or updated
  • Documentation has been updated if necessary
  • Pull request is linked to an open issue

@GiovanniCanali GiovanniCanali self-assigned this Dec 4, 2025
@GiovanniCanali GiovanniCanali added enhancement New feature or request pr-to-fix Label for PR that needs modification labels Dec 4, 2025
@GiovanniCanali GiovanniCanali force-pushed the switch_scheduler branch 2 times, most recently from ae7f36c to 41e6e51 Compare December 4, 2025 12:26
@GiovanniCanali GiovanniCanali added pr-to-review Label for PR that are ready to been reviewed and removed pr-to-fix Label for PR that needs modification labels Dec 5, 2025
@GiovanniCanali GiovanniCanali marked this pull request as ready for review December 5, 2025 15:10
@GiovanniCanali GiovanniCanali requested review from a team and dario-coscia as code owners December 5, 2025 15:10

Processing callback <callback/processing_callback.rst>
Optimizer callback <callback/optimizer_callback.rst>
Switch Scheduler <callback/switch_scheduler.rst>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would keep the Scheduler callback, so that in the future, we can add other callbacks there

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This differs from #445, where we chose to name each file after the class it contains.

That said, your observation raises a valid point. My proposal is the following: within the callback directory, we create a dedicated scheduler subdirectory that, for now, will include only switch_scheduler.py, while leaving room for future additions. This prevents the file from becoming overly long as more scheduler-related callbacks are introduced.

The same structure would apply to optimizer_callback and processing_callback. In particular, the layout I have in mind is the following:

-- callback
-------- scheduler_callback
--------------- switch_scheduler.py
-------- optimizer_callback
--------------- switch_optimizer.py
--------- refinement
--------------- refinement_interface.py
--------------- r3_refinement.py
-------- processing_callback
--------------- metric_tracker.py
--------------- pina_progress_bar.py
--------------- normalizer_data_callback.py

Happy to hear your thoughts on this, @dario-coscia @FilippoOlivo @ndem0.

All these changes would be implemented in a dedicated PR.

Copy link
Member

Choose a reason for hiding this comment

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

-- callback
-------- scheduler
--------------- switch_scheduler.py
-------- optimizer
--------------- switch_optimizer.py
--------- refinement
--------------- refinement_interface.py
--------------- r3_refinement.py
-------- processing
---------------  metric_tracker.py
--------------- pina_progress_bar.py
--------------- normalizer_data_callback.py

I prefer something like this (just remove callback on the subfolders)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Very good! Maybe I would fuse scheduler and optimizer in optim directory (this is similar to from pina.optim import ...)

@GiovanniCanali GiovanniCanali merged commit 664b058 into mathLab:dev Dec 10, 2025
17 of 19 checks passed
@GiovanniCanali GiovanniCanali deleted the switch_scheduler branch December 10, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pr-to-review Label for PR that are ready to been reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants