Skip to content

Commit eaa0515

Browse files
committed
remove update_to_current_format
1 parent 2c463b2 commit eaa0515

File tree

1 file changed

+5
-14
lines changed
  • bioimageio/core/resource_io

1 file changed

+5
-14
lines changed

bioimageio/core/resource_io/io_.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,22 @@ def _replace_relative_paths_for_remote_source(
9696

9797
def load_raw_resource_description(
9898
source: Union[dict, os.PathLike, IO, str, bytes, raw_nodes.URI, RawResourceDescription],
99-
update_to_current_format: bool = True,
100-
update_to_format: Optional[str] = None,
99+
update_to_format: Optional[str] = "latest",
101100
) -> RawResourceDescription:
102101
"""load a raw python representation from a BioImage.IO resource description file (RDF).
103102
Use `load_resource_description` for a more convenient representation.
104103
105104
Args:
106105
source: resource description file (RDF)
107-
update_to_current_format: if True (default) attempt auto-conversion to latest format version
108-
(most bioimageio.core functionality expects the latest format version for each resource)
109-
update_to_format: update resource to specific major.minor format version; ignoring patch version.
106+
update_to_format: update resource to specific "major.minor" or "latest" format version; ignoring patch version.
110107
111108
Returns:
112109
raw BioImage.IO resource
113110
"""
114111
if isinstance(source, RawResourceDescription):
115112
return source
116113

117-
raw_rd = spec.load_raw_resource_description(
118-
source, update_to_current_format=update_to_current_format, update_to_format=update_to_format
119-
)
114+
raw_rd = spec.load_raw_resource_description(source, update_to_format=update_to_format)
120115
raw_rd = _replace_relative_paths_for_remote_source(raw_rd, raw_rd.root_path)
121116
return raw_rd
122117

@@ -191,7 +186,6 @@ def export_resource_package(
191186
compression: int = ZIP_DEFLATED,
192187
compression_level: int = 1,
193188
output_path: Optional[os.PathLike] = None,
194-
update_to_current_format: bool = False,
195189
update_to_format: Optional[str] = None,
196190
weights_priority_order: Optional[Sequence[Union[str]]] = None,
197191
) -> pathlib.Path:
@@ -203,17 +197,14 @@ def export_resource_package(
203197
compression_level: Compression level to use when writing files to the archive.
204198
See https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile
205199
output_path: file path to write package to
206-
update_to_current_format: If True attempt auto-conversion to latest format version.
207-
update_to_format: update resource to specific major.minor format version; ignoring patch version.
200+
update_to_format: update resource to specific "major.minor" or "latest" format version; ignoring patch version.
208201
weights_priority_order: If given only the first weights format present in the model is included.
209202
If none of the prioritized weights formats is found all are included.
210203
211204
Returns:
212205
path to zipped BioImage.IO package in BIOIMAGEIO_CACHE_PATH or 'output_path'
213206
"""
214-
raw_rd = load_raw_resource_description(
215-
source, update_to_current_format=update_to_current_format, update_to_format=update_to_format
216-
)
207+
raw_rd = load_raw_resource_description(source, update_to_format=update_to_format)
217208
package_content = get_local_resource_package_content(raw_rd, weights_priority_order)
218209
if output_path is None:
219210
package_path = _get_tmp_package_path(raw_rd, weights_priority_order)

0 commit comments

Comments
 (0)