Jump to content

Confusion about component.get_availability() return


Evan Hale

Recommended Posts

Documentation states this should return a percentage on sequence components. Instead, it appears to return a dictionary of all file components' availability. Is this the intended return and documentation is wrong?

Quote

Components in locations have a notion of availability. For regular components, consisting of a single file, the availability would be either 0 if the component is unavailable or 100 percent if the component is available in the location. Composite components, like image sequences, have an availability which is proportional to the amount of child components that have been added to the location.

https://ftrack-python-api.rtd.ftrack.com/en/2.3.0/locations/tutorial.html

Link to comment
Share on other sites

HI @Evan Hale
could you please post or send to support the code you are running ?

The follwing snippet seems to return the availablity correctly:

component = session.query('SequenceComponent').first()
location = session.pick_location()
location.get_component_availability(component )
>> 0.0

hope it helps.

P.s
Looking back at the code , the call thatreturns a dictionary is on the component and not on the location:

 

component.get_availability()
>> {'5929f24c-b015-4d48-b533-e0008fc5dd14': 0.0, '80dd99a3-1....'}

This is because is returning the availablity for all the locations

you can find the location avilability passing the location itself into the method:

component.get_availability([location])
>> {'5929f24c-b015-4d48-b533-e0008fc5dd14': 0.0}


we'll have a look at updating the docs where needed.
Thanks for reporting.

L.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...