Skip to content

Commit

Permalink
Merge branch 'OSGeo:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
a0x8o authored Aug 26, 2024
2 parents ad6317b + cbc418e commit b976064
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 42 deletions.
14 changes: 6 additions & 8 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,15 @@ per-file-ignores =
python/grass/pygrass/raster/category.py: E721
python/grass/pygrass/rpc/__init__.py: F401, F403
python/grass/pygrass/utils.py: E402
python/grass/temporal/abstract_space_time_dataset.py: F841, E722
python/grass/temporal/c_libraries_interface.py: F841, E722
python/grass/temporal/abstract_space_time_dataset.py: E722
python/grass/temporal/c_libraries_interface.py: E722
python/grass/temporal/core.py: E722
python/grass/temporal/datetime_math.py: F841, E722
python/grass/temporal/open_stds.py: F841
python/grass/temporal/datetime_math.py: E722
python/grass/temporal/spatial_topology_dataset_connector.py: E722
python/grass/temporal/temporal_algebra.py: F841, E722
python/grass/temporal/temporal_granularity.py: F841, E722
python/grass/temporal/temporal_raster_base_algebra.py: F841, E722
python/grass/temporal/temporal_algebra.py: E722
python/grass/temporal/temporal_granularity.py: E722
python/grass/temporal/temporal_raster_base_algebra.py: E722
python/grass/temporal/temporal_topology_dataset_connector.py: E722
python/grass/temporal/temporal_vector_algebra.py: F841
python/grass/temporal/univar_statistics.py: E231
# Current benchmarks/tests are changing sys.path before import.
# Possibly, a different approach should be taken there anyway.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
if: ${{ matrix.language == 'c-cpp' }}

- name: Initialize CodeQL
uses: github/codeql-action/init@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
uses: github/codeql-action/init@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -81,6 +81,6 @@ jobs:
run: .github/workflows/build_ubuntu-22.04.sh "${HOME}/install"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
uses: github/codeql-action/analyze@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
path: bandit.sarif

- name: Upload SARIF File into Security Tab
uses: github/codeql-action/upload-sarif@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
uses: github/codeql-action/upload-sarif@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # v3.26.5
with:
sarif_file: bandit.sarif

Expand Down
3 changes: 0 additions & 3 deletions python/grass/temporal/abstract_space_time_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5121,7 +5121,6 @@ def register_map(self, map, dbif=None):

# Get basic info
map_id = map.base.get_id()
map_mapset = map.base.get_mapset()
map_rel_time_unit = map.get_relative_time_unit()
map_ttype = map.get_temporal_type()

Expand Down Expand Up @@ -5376,8 +5375,6 @@ def update_from_registered_maps(self, dbif=None):
use_start_time = False

# Get basic info
stds_name = self.base.get_name()
stds_mapset = self.base.get_mapset()
sql_path = get_sql_template_path()
stds_register_table = self.get_map_register()

Expand Down
2 changes: 1 addition & 1 deletion python/grass/temporal/datetime_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def check_datetime_string(time_string, use_dateutil=True):
# relative time. dateutil will interpret a single number as a valid
# time string, so we have to catch this case beforehand
try:
value = int(time_string)
int(time_string)
return _("Time string seems to specify relative time")
except ValueError:
pass
Expand Down
2 changes: 0 additions & 2 deletions python/grass/temporal/open_stds.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ def open_new_map_dataset(
"""

mapset = get_current_mapset()

dbif, connection_state_changed = init_dbif(dbif)
new_map = check_new_map_dataset(name, layer, type, overwrite, dbif)

Expand Down
2 changes: 0 additions & 2 deletions python/grass/temporal/temporal_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,6 @@ def eval_global_var(self, gvar, maplist):
:return: List of maps from maplist with added conditional boolean values.
"""
boollist = []
# Loop over maps of input map list.
for map_i in maplist:
# Get dictionary with temporal variables for the map.
Expand Down Expand Up @@ -2257,7 +2256,6 @@ def build_condition_list(self, tvarexpr, thenlist, topolist=["EQUAL"]):
# self.msgr.fatal("Condition list is not complete. Elements missing")
for iter in range(len(tvarexpr)):
expr = tvarexpr[iter]
operator = tvarexpr[iter + 1]
relexpr = tvarexpr[iter + 2]
if all(issubclass(type(ele), list) for ele in [expr, relexpr]):
resultlist = self.build_spatio_temporal_topology_list(expr, relexpr)
Expand Down
4 changes: 2 additions & 2 deletions python/grass/temporal/temporal_granularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ def check_granularity_string(granularity, temporal_type):
return False

try:
integer = int(num)
int(num)
except:
return False
elif temporal_type == "relative":
try:
integer = int(granularity)
int(granularity)
except:
return False
else:
Expand Down
12 changes: 5 additions & 7 deletions python/grass/temporal/temporal_raster_base_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ def operator_cmd_value(
"""

temporal_relations = map_i.get_temporal_relations()
spatial_relations = map_i.get_spatial_relations()

# Build comandlist list with elements from related maps and given relation
# operator.
Expand Down Expand Up @@ -933,7 +932,7 @@ def p_statement_assign(self, t):
map_i.insert(dbif)
# Register map in result space time dataset.
if self.dry_run is False:
success = resultstds.register_map(map_i, dbif)
resultstds.register_map(map_i, dbif)

if self.dry_run is False:
resultstds.update_from_registered_maps(dbif)
Expand Down Expand Up @@ -1040,10 +1039,10 @@ def p_arith1_operation(self, t):
break
if count == 0:
# Set map name.
name = map_new.get_id()
map_new.get_id()
else:
# Generate an intermediate map
name = self.generate_map_name()
self.generate_map_name()

# Create r.mapcalc expression string for the operation.
cmdstring = self.build_command_string(
Expand Down Expand Up @@ -1208,10 +1207,10 @@ def p_arith2_operation(self, t):
break
if count == 0:
# Set map name.
name = map_new.get_id()
map_new.get_id()
else:
# Generate an intermediate map
name = self.generate_map_name()
self.generate_map_name()

# Create r.mapcalc expression string for the operation.
cmdstring = self.build_command_string(
Expand Down Expand Up @@ -2038,7 +2037,6 @@ def p_hash_operation(self, t):
for obj in map_i.map_value:
if isinstance(obj, GlobalTemporalVar):
n_maps = obj.td
mapinput = map_i.get_id()
# Create r.mapcalc expression string for the operation.
cmdstring = "(%s)" % (n_maps)
# Append module command.
Expand Down
15 changes: 1 addition & 14 deletions python/grass/temporal/temporal_vector_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,6 @@ def build_spatio_temporal_topology_list(
"STARTED",
"FINISHED",
]
complementdict = {
"EQUAL": "EQUAL",
"FOLLOWS": "PRECEDES",
"PRECEDES": "FOLLOWS",
"OVERLAPS": "OVERLAPPED",
"OVERLAPPED": "OVERLAPS",
"DURING": "CONTAINS",
"CONTAINS": "DURING",
"STARTS": "STARTED",
"STARTED": "STARTS",
"FINISHES": "FINISHED",
"FINISHED": "FINISHES",
}
resultdict = {}
# Check if given temporal relation are valid.
for topo in topolist:
Expand Down Expand Up @@ -577,7 +564,7 @@ def p_statement_assign(self, t):
# Register map in result space time dataset.
if self.debug:
print(map_i.get_temporal_extent_as_tuple())
success = resultstds.register_map(map_i, dbif=dbif)
resultstds.register_map(map_i, dbif=dbif)
resultstds.update_from_registered_maps(dbif)

# Remove intermediate maps
Expand Down

0 comments on commit b976064

Please sign in to comment.