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

style(temporal): Sort and group imports #3959

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

echoix
Copy link
Member

@echoix echoix commented Jul 1, 2024

Uses a combination of ruff check --output-format=concise --select I --fix 'temporal/' 'python/grass/temporal', isort --profile=black temporal python/grass/temporal and black .

I separated the big __init__.py as I want to make sure that there aren't any side effects when importing (for python code, it shouldn't have some, but by seeing the state of some of the files, I wouldn't be surprised if there were some finally).

Also, especially for the temporal framework, the big big __init__.py means that everything there is "shortcut-ed" to be available in the scope when importing grass.temporal. I'm not ready to accuse this of being the cause of temporal being slow, but during my last weekend's exploration on trying to profile some temporal tests, after fixing the big slowdown inside one loop of the ply library (that took 18% of the whole time), a big chunk of the remaining time was for importing, at least for t.rast.algebra. So cleaning up the imports and importing what is needed in the files needed (avoiding star imports) might help a little.

@echoix echoix requested a review from ninsbl July 1, 2024 00:16
@echoix echoix added this to the 8.5.0 milestone Jul 1, 2024
@github-actions github-actions bot added temporal Related to temporal data processing Python Related code is in Python libraries module tests Related to Test Suite labels Jul 1, 2024
@echoix echoix force-pushed the group-sort-import-temporal branch from 0aff1b5 to b1994a6 Compare July 1, 2024 01:00
echoix added 2 commits July 1, 2024 01:10
Uses a combination of `ruff check --output-format=concise --select I --fix 'temporal/' 'python/grass/temporal'`, `isort --profile=black temporal python/grass/temporal` and `black .`
@echoix echoix force-pushed the group-sort-import-temporal branch from b1994a6 to 83d3adf Compare July 1, 2024 01:10
@echoix echoix enabled auto-merge (squash) July 1, 2024 02:41
@echoix echoix merged commit 4f1b897 into OSGeo:main Jul 1, 2024
26 checks passed
@echoix echoix deleted the group-sort-import-temporal branch July 1, 2024 06:11
cyliang368 pushed a commit to cyliang368/grass that referenced this pull request Jul 1, 2024
* style(temporal): Sort and group imports

Uses a combination of `ruff check --output-format=concise --select I --fix 'temporal/' 'python/grass/temporal'`, `isort --profile=black temporal python/grass/temporal` and `black .`

* style(temporal): Sort and group imports for __init__.py
@a0x8o a0x8o mentioned this pull request Jul 1, 2024
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Jul 2, 2024
* style(temporal): Sort and group imports

Uses a combination of `ruff check --output-format=concise --select I --fix 'temporal/' 'python/grass/temporal'`, `isort --profile=black temporal python/grass/temporal` and `black .`

* style(temporal): Sort and group imports for __init__.py
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Jul 23, 2024
* style(temporal): Sort and group imports

Uses a combination of `ruff check --output-format=concise --select I --fix 'temporal/' 'python/grass/temporal'`, `isort --profile=black temporal python/grass/temporal` and `black .`

* style(temporal): Sort and group imports for __init__.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libraries module Python Related code is in Python temporal Related to temporal data processing tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants