@@ -96,27 +96,22 @@ def _replace_relative_paths_for_remote_source(
96
96
97
97
def load_raw_resource_description (
98
98
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" ,
101
100
) -> RawResourceDescription :
102
101
"""load a raw python representation from a BioImage.IO resource description file (RDF).
103
102
Use `load_resource_description` for a more convenient representation.
104
103
105
104
Args:
106
105
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.
110
107
111
108
Returns:
112
109
raw BioImage.IO resource
113
110
"""
114
111
if isinstance (source , RawResourceDescription ):
115
112
return source
116
113
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 )
120
115
raw_rd = _replace_relative_paths_for_remote_source (raw_rd , raw_rd .root_path )
121
116
return raw_rd
122
117
@@ -191,7 +186,6 @@ def export_resource_package(
191
186
compression : int = ZIP_DEFLATED ,
192
187
compression_level : int = 1 ,
193
188
output_path : Optional [os .PathLike ] = None ,
194
- update_to_current_format : bool = False ,
195
189
update_to_format : Optional [str ] = None ,
196
190
weights_priority_order : Optional [Sequence [Union [str ]]] = None ,
197
191
) -> pathlib .Path :
@@ -203,17 +197,14 @@ def export_resource_package(
203
197
compression_level: Compression level to use when writing files to the archive.
204
198
See https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile
205
199
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.
208
201
weights_priority_order: If given only the first weights format present in the model is included.
209
202
If none of the prioritized weights formats is found all are included.
210
203
211
204
Returns:
212
205
path to zipped BioImage.IO package in BIOIMAGEIO_CACHE_PATH or 'output_path'
213
206
"""
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 )
217
208
package_content = get_local_resource_package_content (raw_rd , weights_priority_order )
218
209
if output_path is None :
219
210
package_path = _get_tmp_package_path (raw_rd , weights_priority_order )
0 commit comments