Skip to content

Comments

DRAFT: Refactor utils and tools, add first party source for ruff and set initial environmenet#590

Closed
LucaRom wants to merge 6 commits intolightning_refactorfrom
repo_updates
Closed

DRAFT: Refactor utils and tools, add first party source for ruff and set initial environmenet#590
LucaRom wants to merge 6 commits intolightning_refactorfrom
repo_updates

Conversation

@LucaRom
Copy link
Collaborator

@LucaRom LucaRom commented Jul 31, 2025

Main update is a suggested refactoring of the tools folder and the utils.py file.

The vision is to promote modularity and future growth of GDL while avoiding a clogged utils.py file as we add different use cases and projects.

Distinction between tools and utils:

  • utils : Modular and reusable generic functions that are as much of possible context-agnostic and could be used across any dataset, datamodule, project, etc.
  • tools : Contains high-level components, wrappers and project/domain specific functions. (logging, schedulers, water extraction specific functions, etc.)

Refactoring details :

  • utils.py is split into 2 new files under the utils folder (models.py and tensors.py)
  • raster.py contains new generic functions that were created when working on the water extraction
  • tools folder stays as is, minus the utils.py file

Other updates:

Smaller commits are also included in this PR:

  • First party source was specified in the pyproject.toml file. This ensures that imports from the GDL-specific modules are recognized as first-party and are therefore grouped separately during auto-formatting.
  • A first version of the environment.yml file was added as it is also needed for the github action on push.
  • A dummy test was created to make the github actions on push pass.

LucaRom added 6 commits July 30, 2025 21:37
Removed tools/utils.py and added a dedicated utils folder containing models.py, rasters.py and tensors.py

Existing utils functions were splitted between models.py and tensors.py

New generic functions for rasters were added to rasters.py

Updated the imports in the tasks_with_models files to reflect those changes
@LucaRom LucaRom changed the title Refactor utils and tools, add first party source for ruff and set initial environmenet DRAFT: Refactor utils and tools, add first party source for ruff and set initial environmenet Sep 11, 2025
@LucaRom LucaRom marked this pull request as draft September 11, 2025 14:01
@LucaRom LucaRom closed this in #599 Oct 15, 2025
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.

1 participant