StellarDensityMap attribute error

I’m trying to generate a StellarDensityMap (with the goal of getting a map for white dwarfs, specifically), however I’m getting an error in the process. I’m not sure if the example code I’m trying to run is outdated, or something else wrong with this.

I’m using the StellarDensityMap code here as a guide:

However, I’m getting an error when it runs, and I’ve not had any luck resolving it:

ERROR: AttributeError: type object 'StellarDensityMap' has no attribute '_MetricBundle__name' [lsst.sims.maf.metricBundles.metricBundle]
Traceback (most recent call last):
File "", line 21, in <module>
bundle = metricBundles.MetricBundle(metric,slicer,sql, mapsList=[mafMap], plotDict=plotDict)
File "/home/mike/lsst/stack/miniconda3-4.3.21-10a4fa6/Linux64/sims_maf/2.4.0.sims+1/python/lsst/sims/maf/metricBundles/", line 94, in __init__
mapNames = [map.__class__.__name for map in self.mapsList]
File "/home/mike/lsst/stack/miniconda3-4.3.21-10a4fa6/Linux64/sims_maf/2.4.0.sims+1/python/lsst/sims/maf/metricBundles/", line 94, in <listcomp>
mapNames = [map.__class__.__name for map in self.mapsList]
AttributeError: type object 'StellarDensityMap' has no attribute '_MetricBundle__name'

The one thing I tried is that there were some issues mentioned with the Star Maps in this conversation:

I’ve tried changing those filenames and that doesn’t matter, so that rules that out. I’m not sure if the code I’m trying to run still works with the current code, or if it’s an installation error. This is a recent install, so in theory everything should be current.

Thanks in advance

Looks like that was just a typo where __name should have been __name__. I’ve fixed MAF master and updated that notebook (it was a little bit-rotted).

(note I really should have also updated the unit test since it should have caught this, but I’ll leave that for @oboberg and @ljones)

Thanks for a quick answer on this. Is there a ‘proper’ way for updating the install I have?

I’m using the following because the instructions indicate that it should update everything:

eups distrib install sims_maf -t sims

However, I’m getting the same error still, so I’m thinking this just means that the correct thing hasn’t updated yet

yes, you have to switch over to using the git repo until we make a new release.

At the bottom of this page under “Mixing Installed Stack with Development Repos”:

you can see the steps for cloning the MAF repo and having eups set it up.

1 Like

Thanks, that’s taken care of the errors, and it’s providing the expected metric output