documentation bug: getting class name fails

Bug #1455621 reported by Bruno Chareyre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Fix Released
Undecided
Bruno Chareyre

Bug Description

In the example code of section [1], class.name fails. I couldn't find the solution myself, still searching...

[1] https://yade-dem.org/doc/prog.html?highlight=classname#run-time-type-identification-rtti

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote :

Another failure in documentation (maybe unrelated, but...)
Vector3 and Quaternion not found:
https://yade-dem.org/doc/prog.html?highlight=classname#basic-numerics

Revision history for this message
Anton Gladky (gladky-anton) wrote :

Only HTML-build is affected, PDF has no such errors.

Revision history for this message
Václav Šmilauer (eudoxos) wrote : Re: [Yade-dev] [Bug 1455621] [NEW] documentation bug: getting class name fails

> Public bug reported:
>
> In the example code of section [1], class.name fails. I couldn't find
> the solution myself, still searching...
>
> [1] https://yade-dem.org/doc/prog.html?highlight=classname#run-time-type-identification-rtti
use Sphere().__class__.__name__

v.

Revision history for this message
Chareyre (bruno-chareyre-9) wrote :

@Vaclav, yes indeed but I'm nearly sure there is another way (like
getClassName, or classIndex, or something), even probably used in some
exemple scripts, but I couldn't find it.

On 17 May 2015 at 00:28, Václav Šmilauer <email address hidden> wrote:

> > Public bug reported:
> >
> > In the example code of section [1], class.name fails. I couldn't find
> > the solution myself, still searching...
> >
> > [1]
> https://yade-dem.org/doc/prog.html?highlight=classname#run-time-type-identification-rtti
> use Sphere().__class__.__name__
>
> v.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1455621
>
> Title:
> documentation bug: getting class name fails
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/yade/+bug/1455621/+subscriptions
>
>

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

It might have been removed. Those things are in lib/serialization/Serializable.cpp; I grepped the source for getClassName everywhere and it is not exposed to Python. gui/qt4/SerializableEditor.py uses __class__.__name__ everywhere. You can always define an alias by saying "Serializable.name=property(lambda s: s.__class__.__name__)" somewhere at Yade startup, but I don't think it is useful to duplicate the functionality python already has. v.

Revision history for this message
Jérôme Duriez (jduriez) wrote :

For comment #1 at least, see also https://bugs.launchpad.net/yade/+bug/1378717 ?

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote :

Fixed following either Vaclav's #3 (thanks) or 'isinstance' (recommended method).
https://bugs.launchpad.net/yade/+bug/1455621

Changed in yade:
assignee: nobody → Bruno Chareyre (bruno-chareyre)
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.