Skip to content

Commit a250a39

Browse files
committed
Load the correct class for converters, enable verbose mode via env, move block size check so that it applies for all downloads
1 parent e61e1ca commit a250a39

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [v0.2.14] - 2026-02-13
11+
12+
- Load the most specific class for converters
13+
- Enable verbose mode via env `VECOREL_VERBOSE` set to `1`
14+
- Converters: Move block size check so that it applies for all downloads
15+
1016
## [v0.2.13] - 2026-02-13
1117

1218
- Change default compression to zstd
@@ -92,7 +98,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9298

9399
- First release based on vecorel CLI 0.1.0
94100

95-
[Unreleased]: <https://github.com/vecorel/cli/compare/v0.2.13...main>
101+
[Unreleased]: <https://github.com/vecorel/cli/compare/v0.2.14...main>
102+
[v0.2.14]: <https://github.com/vecorel/cli/compare/v0.2.13...v0.2.14>
96103
[v0.2.13]: <https://github.com/vecorel/cli/compare/v0.2.12...v0.2.13>
97104
[v0.2.12]: <https://github.com/vecorel/cli/compare/v0.2.11...v0.2.12>
98105
[v0.2.11]: <https://github.com/vecorel/cli/compare/v0.2.10...v0.2.11>

vecorel_cli/cli/logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import re
23
import sys
34
from logging import Logger
@@ -13,7 +14,7 @@ def format_logs(record):
1314

1415

1516
class LoggerMixin:
16-
verbose: bool = False
17+
verbose: bool = os.environ.get("VEOREL_VERBOSE", "0") == "1"
1718
logger: Optional[Logger] = None
1819

1920
def __init__(self):

vecorel_cli/conversion/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ def download_files(self, uris, cache_folder=None, **kwargs):
104104
if isinstance(uris, str):
105105
uris = {uris: name_from_uri(uris)}
106106

107+
if self.avoid_range_request and "block_size" not in kwargs:
108+
kwargs["block_size"] = 0
109+
107110
paths = []
108111
for uri, target in uris.items():
109112
is_archive = isinstance(target, list)
@@ -322,10 +325,7 @@ def convert(
322325
raise ValueError("No input files provided")
323326

324327
self.info("Getting file(s) if not cached yet")
325-
request_args = {}
326-
if self.avoid_range_request:
327-
request_args["block_size"] = 0
328-
paths = self.download_files(urls, cache, **request_args)
328+
paths = self.download_files(urls, cache)
329329

330330
gdf = self.read_data(paths, **self.open_options)
331331
self.info("GeoDataFrame created from source(s):")

vecorel_cli/converters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def get_class(self, name):
101101
if type(v) is type
102102
and issubclass(v, base_class)
103103
and base_class.__name__ not in v.__name__
104+
and v.__module__ == module.__name__
104105
)
105106
return clazz(self)
106107
except StopIteration:

0 commit comments

Comments
 (0)