phetsims / density-buoyancy-common

Common code for the Density and Buoyancy simulations
GNU General Public License v3.0
0 stars 2 forks source link

Assertion errors customizing mystery materials #405

Closed Nancy-Salpepi closed 1 month ago

Nancy-Salpepi commented 1 month ago

Test device MacBook Air M1 chip

Operating System 14.6.1

Browser Safari 17.6

Problem description For https://github.com/phetsims/qa/issues/1141, assertion errors appear when trying to customize the fluid density in Buoyancy. For all fluids the densityProperty range listed in studio is .08 to 27000, but that doesn't seem to be the case. Assertion errors appear when trying to set a fluid's density within the listed range.

Steps to reproduce Here is an example:

  1. In studio, go to the Explore screen and select Fluid B
  2. go to buoyancy.global.model.materials.fluids.fluidB.densityProperty
  3. set the value to 100 --assertion errors appear in console

Visuals

Screenshot 2024-09-16 at 8 30 05 AM Screenshot 2024-09-16 at 8 30 21 AM Screenshot 2024-09-16 at 8 32 15 AM
Nancy-Salpepi commented 1 month ago

I see something similar with the materials.

Example Steps:

  1. In studio, go to the Lab Screen and select material T
  2. Go to buoyancy.global.model.materials.solids.materialT.densityProperty
  3. Set the value at 5
samreid commented 1 month ago

This one is easy to reproduce, it seems like a mappedWrappedProperty.customValue.valueProperty has the wrong range: 500, 15000 but I cannot track down. Would be good to get help from @zepumph or collaborate.

zepumph commented 1 month ago

We are hitting this block:

We should not generally cascade to the custom density when PhET-iO changes the density. At least I think that is the case. Not sure how to solve though.

https://github.com/phetsims/density-buoyancy-common/blob/6ba45b6a5fdbece5cba9590f520571a529697b35/js/common/model/MappedWrappedProperty.ts#L66-L74

zepumph commented 1 month ago

Paper trail on the above block. https://github.com/phetsims/density-buoyancy-common/issues/281

Nancy-Salpepi commented 1 month ago

I'm no longer seeing assertion errors when setting values in rc.2 Closing.