Skip to content

Commit

Permalink
Merge branch 'grass8' into i.sam2
Browse files Browse the repository at this point in the history
  • Loading branch information
cwhite911 authored Feb 3, 2025
2 parents d8d8e8a + fd57cbb commit 0ffc3c5
Show file tree
Hide file tree
Showing 270 changed files with 549 additions and 1,002 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/additional_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
exclude: mswindows .*\.bat .*/testsuite/data/.*

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
# renovate: datasource=python-version depName=python
PYTHON_VERSION: "3.12"
# renovate: datasource=pypi depName=black
BLACK_VERSION: "24.10.0"
BLACK_VERSION: "25.1.0"
permissions: {}
jobs:
run-black:
Expand All @@ -34,7 +34,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
sudo apt-get install -y --no-install-recommends --no-install-suggests
- name: Set up Python ${{ matrix.python-version }} as default Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand Down
102 changes: 102 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,105 @@ OBJ.*
*.pyc
*.o
*.tmp.html
bin.*/*
dist.*/*
config.log
config.status*
error.log


# notebook helper files
.ipynb_checkpoints

# ignore gunittest helper and result files
testreport/*
testsuite/examples/testreports/
test_keyvalue_result.txt

# Ignore code coverage files
*.gcov
*.gcno
*.gcda
.coverage
.coverage.*
coverage.xml


# Created by https://www.toptal.com/developers/gitignore/api/windows,linux,macos
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,linux,macos

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows,linux,macos
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ repos:
.*\.svg$
)
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
rev: v0.44.0
hooks:
- id: markdownlint-fix
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black-jupyter
- repo: https://github.com/pycqa/flake8
Expand Down
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[project]
name = "grass-addons"
requires-python = ">=3.8"

[tool.black]
required-version = '24'
required-version = '25'
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
target-version = ['py38', 'py39', 'py310', 'py311', 'py312', 'py313']
extend-exclude = '''
(
# exclude directories in the root of the project
Expand All @@ -20,3 +24,7 @@ extend-exclude = '''
)/
)
'''

[tool.ruff]
required-version = ">=0.9.4"
builtins = ["_"]
3 changes: 0 additions & 3 deletions src/display/d.vect.thematic2/d.vect.thematic2.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,6 @@ def main():
# graduated points and line widths thematic mapping

if themetype in ["graduated_points", "graduated_lines"]:

# display graduated points/lines by intervals
if themecalc == "interval":
out(
Expand Down Expand Up @@ -1013,7 +1012,6 @@ def main():

# display graduated points/lines for standard deviation units
if themecalc == "std_deviation":

out(
f_graph,
locals(),
Expand Down Expand Up @@ -1045,7 +1043,6 @@ def main():

# display graduated points/lines for quartiles
if themecalc == "quartiles":

out(
f_graph,
locals(),
Expand Down
8 changes: 4 additions & 4 deletions src/general/g.citation/g.citation.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ def internal_to_csl_json(citation):


def print_using_citeproc(csl_json, keys, style):

from citeproc import CitationStylesStyle, CitationStylesBibliography
from citeproc import Citation, CitationItem
from citeproc import formatter
Expand Down Expand Up @@ -778,8 +777,9 @@ def print_chicago_footnote(citation, output):
authors_text += ", and "
title = "GRASSS GIS module {}".format(citation["module"])
print(
"{authors_text}, {title} ({grass-version}), computer software"
" ({year}).".format(authors_text=authors_text, title=title, **citation),
"{authors_text}, {title} ({grass-version}), computer software ({year}).".format(
authors_text=authors_text, title=title, **citation
),
file=output,
)

Expand Down Expand Up @@ -937,7 +937,7 @@ def main(options, flags):
if output_format == "citeproc":
if not options["style"]:
gs.fatal(
_("Option format=citeproc requires also" " the option style to be set")
_("Option format=citeproc requires also the option style to be set")
)
vertical_separator = options["vertical_separator"]
output = options["output"]
Expand Down
14 changes: 8 additions & 6 deletions src/general/g.download.location/g.download.location.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ def move_extracted_files(extract_dir, target_dir, files):
def extract_zip(name, directory, tmpdir):
"""Extract a ZIP file into a directory"""
gs.debug(
"extract_zip(name={name}, directory={directory},"
" tmpdir={tmpdir})".format(name=name, directory=directory, tmpdir=tmpdir),
"extract_zip(name={name}, directory={directory}, tmpdir={tmpdir})".format(
name=name, directory=directory, tmpdir=tmpdir
),
3,
)
try:
Expand All @@ -136,8 +137,9 @@ def extract_zip(name, directory, tmpdir):
def extract_tar(name, directory, tmpdir):
"""Extract a TAR or a similar file into a directory"""
gs.debug(
"extract_tar(name={name}, directory={directory},"
" tmpdir={tmpdir})".format(name=name, directory=directory, tmpdir=tmpdir),
"extract_tar(name={name}, directory={directory}, tmpdir={tmpdir})".format(
name=name, directory=directory, tmpdir=tmpdir
),
3,
)
try:
Expand Down Expand Up @@ -167,7 +169,7 @@ def download_end_extract(source):
f, h = urlretrieve(source, archive_name)
if h.get("content-type", "") != "application/zip":
raise DownloadError(
_("Download of <%s> failed " "or file is not a ZIP file") % source
_("Download of <%s> failed or file is not a ZIP file") % source
)
extract_zip(name=archive_name, directory=directory, tmpdir=tmpdir)
elif "." in source and (
Expand Down Expand Up @@ -257,7 +259,7 @@ def main(options, flags):
destination = os.path.join(database, name)

if os.path.exists(destination):
gs.fatal(_("Location named <%s> already exists," " download canceled") % name)
gs.fatal(_("Location named <%s> already exists, download canceled") % name)
return

gs.message(_("Downloading and extracting..."))
Expand Down
1 change: 0 additions & 1 deletion src/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ def argParser(
return False

def run(self, argv):

if len(argv) == 0:
grass.error("Nothing to do. Set args")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,6 @@ def initEditor(
GMessage("Select map in data catalog...")

def _layout(self):

self.mainSizer = wx.BoxSizer(wx.VERTICAL)

# self.toolbarPanelSizer = wx.BoxSizer(wx.HORIZONTAL)
Expand Down
21 changes: 6 additions & 15 deletions src/gui/wxpython/wx.metadata/m.csw.update/m.csw.update.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ def __init__(
active_xml_csw_url=False,
not_valid_xml_csw_url=False,
):

from mdlib.dependency import check_dependencies

module_not_found = []
Expand Down Expand Up @@ -384,8 +383,7 @@ def _spreadsheet_file_url(self, path):
if not os.path.exists(path):
gscript.fatal(
_(
"Spreadsheets file '{}' "
"doesn't exists.".format(
"Spreadsheets file '{}' doesn't exists.".format(
path,
),
),
Expand Down Expand Up @@ -432,8 +430,7 @@ def _conns_resrs_xml(self, path):
if not os.path.exists(path):
gscript.fatal(
_(
"Connnections resources file '{}' "
"doesn't exists.".format(
"Connnections resources file '{}' doesn't exists.".format(
path,
),
),
Expand Down Expand Up @@ -586,7 +583,7 @@ def _not_valid_xml_csw_url(self):
def _not_valid_xml_csw_url(self, value):
if not isinstance(value, bool):
gscript.fatal(
_("Param 'not_valid_xml_csw_url' arg require " "boolean value"),
_("Param 'not_valid_xml_csw_url' arg require boolean value"),
)
self.__not_valid_xml_csw_url = value

Expand Down Expand Up @@ -1013,7 +1010,7 @@ def append_csw():

def _get_data_format(self):
"""Get dat row format"""
return "{country}, " "{govermental_level}, " "{api_provider}{separator}" "{url}"
return "{country}, {govermental_level}, {api_provider}{separator}{url}"

def _split_data_row(self, row):
"""Split data row string
Expand Down Expand Up @@ -1045,14 +1042,12 @@ def _print_csw_conn_element(self, row):
name, url = self._split_data_row(row)

if self._valid_csw_url:

# Valid and active
if self._active_csw_url:
if (
url not in self._not_valid_csw_urls
and url not in self._not_active_csw_urls
):

self._print_result = join_char.join(
[
self._print_result,
Expand All @@ -1071,7 +1066,6 @@ def _print_csw_conn_element(self, row):
)

elif self._not_valid_csw_url:

if url in self._not_valid_csw_urls:
self._print_result = join_char.join(
[
Expand Down Expand Up @@ -1100,7 +1094,6 @@ def _print_csw_conn_element(self, row):
url in self._not_active_csw_urls
and url not in self._not_valid_csw_urls
):

self._print_result = join_char.join(
[
self._print_result,
Expand Down Expand Up @@ -1165,8 +1158,7 @@ def _print_summary_stats(self):
[
self._print_summary_result,
(
"Number of new connections resource"
"{value:.>25}{eof}".format(
"Number of new connections resource{value:.>25}{eof}".format(
value=self._new_connections
- len(self._not_valid_csw_urls)
- len(self._not_active_csw_urls),
Expand Down Expand Up @@ -1219,8 +1211,7 @@ def _print_summary_stats(self):
[
self._print_summary_result,
(
"Sum"
"{value:.>57}{eof}".format(
"Sum{value:.>57}{eof}".format(
value=self._new_connections,
eof=eof,
)
Expand Down
Loading

0 comments on commit 0ffc3c5

Please sign in to comment.