Skip to content

Commit

Permalink
style(temporal): Sort and group imports (OSGeo#3959)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
echoix authored and a0x8o committed Jul 23, 2024
1 parent 3f261b4 commit 8433de6
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 1 deletion.
8 changes: 8 additions & 0 deletions python/grass/temporal/abstract_space_time_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class that is the base class for all space time datasets.
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
Expand Down Expand Up @@ -87,13 +88,18 @@ class that is the base class for all space time datasets.
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
init_dbif,
)
=======
init_dbif,
)
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
from .datetime_math import increment_datetime_by_string, string_to_datetime
from .spatio_temporal_relationships import (
SpatioTemporalTopologyBuilder,
count_temporal_topology_relationships,
create_temporal_relation_sql_where_statement,
print_spatio_temporal_topology_relationships,
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
=======
=======
Expand All @@ -116,6 +122,8 @@ class that is the base class for all space time datasets.
>>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> dad8f82179 (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
)
from .temporal_granularity import (
check_granularity_string,
Expand Down
5 changes: 5 additions & 0 deletions python/grass/temporal/c_libraries_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 923408bf7e (libpython: Save and load benchmark results (#1711))
=======
Expand Down Expand Up @@ -197,6 +198,10 @@
>>>>>>> 57aff3a06a (pythonlib: Remove star imports (#1546))
>>>>>>> 95adae2f53 (pythonlib: Remove star imports (#1546))
>>>>>>> e2f520cfc3 (pythonlib: Remove star imports (#1546))
=======
import sys
from ctypes import CFUNCTYPE, POINTER, byref, c_int, c_void_p, cast
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
from datetime import datetime
from multiprocessing import Lock, Pipe, Process

Expand Down
3 changes: 3 additions & 0 deletions python/grass/temporal/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import sys
<<<<<<< HEAD
<<<<<<< HEAD
=======
from .core import (
get_tgis_message_interface,
Expand All @@ -23,6 +24,8 @@
from .datetime_math import create_time_suffix
from .datetime_math import create_numeric_suffix
>>>>>>> a9d9dc4896 (style: Fixes sys-exit-alias (PLR1722) (#3951))
=======
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
from multiprocessing import Process

import grass.script as gscript
Expand Down
1 change: 0 additions & 1 deletion python/grass/temporal/mapcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
:authors: Soeren Gebbert
"""

import sys
import copy
import sys
from datetime import datetime
Expand Down
3 changes: 3 additions & 0 deletions python/grass/temporal/spatio_temporal_relationships.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
from .core import init_dbif
from .datetime_math import time_delta_to_relative_time_seconds
<<<<<<< HEAD
<<<<<<< HEAD
=======
from grass.lib import vector
from grass.lib import rtree
from grass.lib import gis
>>>>>>> 85b047f439 (style: Fixes manual-from-import (PLR0402) (#3949))
=======
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))

###############################################################################

Expand Down
4 changes: 4 additions & 0 deletions python/grass/temporal/temporal_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,16 @@
"""

try:
<<<<<<< HEAD
<<<<<<< HEAD
from ply import lex, yacc
=======
from ply import lex
from ply import yacc
>>>>>>> 85b047f439 (style: Fixes manual-from-import (PLR0402) (#3949))
=======
from ply import lex, yacc
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
except:
pass

Expand Down
3 changes: 3 additions & 0 deletions python/grass/temporal/temporal_granularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""
<<<<<<< HEAD

<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
Expand Down Expand Up @@ -86,6 +87,8 @@
from collections import OrderedDict
>>>>>>> bdc1a9eff8 (pythonlib: Remove star imports (#1546))
>>>>>>> 240dcc86f4 (pythonlib: Remove star imports (#1546))
=======
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
import ast
from collections import OrderedDict
from functools import reduce
Expand Down
4 changes: 4 additions & 0 deletions python/grass/temporal/temporal_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,16 @@
""" # noqa: E501

try:
<<<<<<< HEAD
<<<<<<< HEAD
from ply import lex, yacc
=======
from ply import lex
from ply import yacc
>>>>>>> 85b047f439 (style: Fixes manual-from-import (PLR0402) (#3949))
=======
from ply import lex, yacc
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
except ImportError:
pass

Expand Down
9 changes: 9 additions & 0 deletions python/grass/temporal/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
from ctypes import byref
from datetime import datetime
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))

from grass.lib import gis, rtree, vector
from grass.script import core

<<<<<<< HEAD
=======
from grass.script import core
>>>>>>> 85b047f439 (style: Fixes manual-from-import (PLR0402) (#3949))
=======
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
from .abstract_dataset import (
AbstractDatasetComparisonKeyEndTime,
AbstractDatasetComparisonKeyStartTime,
Expand All @@ -34,6 +40,7 @@
compute_absolute_time_granularity,
)

<<<<<<< HEAD
<<<<<<< HEAD
=======
from grass.lib import vector
Expand All @@ -42,6 +49,8 @@
from ctypes import byref

>>>>>>> 85b047f439 (style: Fixes manual-from-import (PLR0402) (#3949))
=======
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
# Uncomment this to detect the error
core.set_raise_on_error(True)

Expand Down
3 changes: 3 additions & 0 deletions temporal/t.vect.what.strds/t.vect.what.strds.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@

import grass.script as grass
<<<<<<< HEAD
<<<<<<< HEAD
=======
from grass.script import raster
>>>>>>> 85b047f439 (style: Fixes manual-from-import (PLR0402) (#3949))
=======
>>>>>>> 4f1b897788 (style(temporal): Sort and group imports (#3959))
from grass.exceptions import CalledModuleError
from grass.script import raster

Expand Down

0 comments on commit 8433de6

Please sign in to comment.