ngl icon indicating copy to clipboard operation
ngl copied to clipboard

removeTrajectory showing console.error message

Open aurel-l opened this issue 6 years ago • 6 comments

Hi,

I have a StructureComponent, to which I've loaded a trajectory. I wanted to remove the trajectory and replace it with an other one. When I use component.removeTrajectory(trajectoryElement) it does work, and I'm still able to add a new trajectory afterwards and have it working. But somehow I get the message "'updateStructure: traj disposed'" (coming from here) through a console.error. I'm a bit confused because, yes, it is supposed to be disposed of, that's what I'm asking the library to do, so why print it as an error of some sort? :thinking:

Thanks for your input on that

(using version 2.0.0-dev.36)

aurel-l avatar Jul 19 '19 09:07 aurel-l

There might very well be some bug in the update logic. Could you have a go at finding out where?

arose avatar Jul 19 '19 15:07 arose

I've got the same error message every time I run stage.removeAllComponents(); which I needed when I load new molecule to the stage.

radifar avatar Jan 13 '24 23:01 radifar

@radifar just to make sure, in order to prioritize development efforts, is the issue "only" having an error message displayed in the console? Or is it that you are unable to remove a trajectory from the stage?

ppillot avatar Jan 15 '24 03:01 ppillot

It is removed correctly. Everything is working just fine as expected, which is weird that I got such error message.

radifar avatar Jan 15 '24 04:01 radifar

Nothing bad is happening: there is a render cycle that is occurring and a check to see whether the coordinates are still available. That's the normal flow of the code. I guess we should better assess whether this branch of the code is taken for the right reasons or due to a genuine error and only report in that case. For now, maybe we can just relegate this to a debug statement.

ppillot avatar Jan 15 '24 04:01 ppillot

For now, maybe we can just relegate this to a debug statement.

I agree

radifar avatar Jan 15 '24 05:01 radifar