SWIFTSIM / swiftgalaxy

Load in particles of a simulated galaxy, rotate coordinates, easy spherical/cylindrical coordinates, access integrated properties, and more.
GNU General Public License v3.0
2 stars 1 forks source link

Tab completion doesn't pass through from swiftsimio #16

Open kyleaoman opened 17 hours ago

kyleaoman commented 17 hours ago

Recent python version support tab completion in interactive use. Currently swiftsimio will tab complete on something like:

>>> sd = SWIFTDataset(snapshot_filename)
>>> sd.gas.<press tab twice>
sd.gas.averaged_star_formation_rates              sd.gas.masses_from_collapsar
sd.gas.compton_yparameters                        sd.gas.masses_from_nsm
sd.gas.coordinates                                sd.gas.masses_from_snia
sd.gas.densities                                  sd.gas.masses_from_snii
sd.gas.densities_at_last_agnevent                 sd.gas.maximal_sniikinetic_feedbackvkick
sd.gas.densities_at_last_supernova_event          sd.gas.maximal_temperature_scale_factors
sd.gas.diffusion_parameters                       sd.gas.maximal_temperatures
<truncated>

Trying this on a SWIFTGalaxy created from the same snapshot doesn't give the same result (although I wish it did) because the tab completion doesn't pick up all of the properties as they're "hidden": sg.gas is not actually a SWIFTDataset but a helper class, the actual SWIFTDataset is sg.gas._particle_dataset. Presumably it's possible to pass through attributes of sg.gas._particle_dataset to the tab completion feature, somehow?