Deprecation of Analysis Inputs Filename APIs
Removed in Flywheel Core 22.0.0
The APIs listed below have been removed in Flywheel Core 22.0.0. Direct API integrations and SDK scripts that identify analysis input files by filename no longer work and must be updated before upgrading. See Migration Examples for the supported replacement patterns.
Change
The Flywheel SDK functions and HTTP API routes listed below were deprecated in Flywheel Core 20.2.0 and have been removed in 22.0.0. In every case the replacement is to identify the input file by file_id and act on the File object directly, as shown in the Migration Examples.
Removed SDK functions
In every replacement snippet below, input is a reloaded File object obtained from an analysis:
Reloading populates input.version and the rest of the File metadata, both of which are needed for the replacement calls.
Download an input file to disk
Replacement: input.download(dest, version=input.version)
download_input_from_analysis()download_input_from_acquisition_analysis()download_input_from_container_analysis()download_input_from_project_analysis()download_input_from_session_analysis()download_input_from_subject_analysis()
Read an input file into memory
Replacement: input.read(version=input.version)
download_input_from_analysis_as_data()download_input_from_acquisition_analysis_as_data()download_input_from_container_analysis_as_data()download_input_from_project_analysis_as_data()download_input_from_session_analysis_as_data()download_input_from_subject_analysis_as_data()
Get a time-limited download URL
Replacement: input.url(version=input.version)
get_analysis_input_download_url()get_acquisition_analysis_input_download_url()get_container_analysis_input_download_url()get_project_analysis_input_download_url()get_session_analysis_input_download_url()get_subject_analysis_input_download_url()
Get input zipfile manifest
Replacement: input.get_zip_info(version=input.version)
get_analysis_input_zip_info()get_acquisition_analysis_input_zip_info()get_container_analysis_input_zip_info()get_project_analysis_input_zip_info()get_session_analysis_input_zip_info()get_subject_analysis_input_zip_info()
Get input file metadata
Replacement: access File attributes on the reloaded input (input.size, input.type, input.modality, input.classification, input.info, input.hash), or client.get_file(input.file_id, version=input.version).
get_analysis_file_info()
Removed HTTP API routes
| Route |
|---|
GET /api/analyses/{cid}/inputs/{filename} |
GET /api/analyses/{cid}/inputs/{filename}/info |
GET /api/{ctype}/{cid}/analyses/{analysis_id}/inputs/{filename} |
GET /api/{ctype}/{cid}/analyses/{analysis_id}/inputs/{filename}/info |
GET /api/{ctype}/{cid}/inputs/{filename}/info |
{ctype} is one of acquisitions, collections, containers, projects, sessions, or subjects.
Reason For Change
- Behavior was undefined when an analysis had multiple inputs that share the same filename.
- Identifying an analysis input by the combination of analysis ID plus filename was ambiguous, because analyses can hold multiple input files referencing different files with the same name.
Recommended Action
Identify analysis input files by their file ID instead of by filename. Each File object on analysis.inputs exposes download(), url(), and read() methods directly, removing the ambiguity entirely.
Migration Examples
The following examples use the Flywheel Python SDK (pip install flywheel-sdk) and assume an authenticated client.
Always reload the input and pass version=
Two pitfalls to avoid when migrating:
- File objects on
analysis.inputsare returned with a subset of fields populated. Call.reload()on the chosen input before downloading or reading it, so thatversionand other metadata are available on the object. download(),url(), andread()default to the latest version of the file on the parent container — not the version captured when the analysis was created. To retrieve the exact bytes the analysis was run against, passversion=input_file.versionexplicitly. The replaced/removed APIs returned the analysis-snapshotted version, so omittingversion=here is a behavior change.
List analysis inputs and obtain each input's file ID
Download an input file
Operate on the File object directly — no filename lookup through the analysis is needed.
Get a time-limited download URL
Get file info / metadata
After reload(), the File object carries the metadata previously returned by get_analysis_file_info() (size, type, modality, classification, info, hash). You can also re-fetch the file by ID at any time using client.get_file().