Sorry about the bounce; indeed I forgot to use the right return address.
Thanks Francesc and Andrew; Andrew's solution works fine and is the
fastest way to go. And I learned something new about Python warnings.
However perhaps it would be nice to have a function that does what I
suggest, as natural naming is a major feature of PyTables. I'll see what
I can do over the weekend, and open an ticket with or without code,
depending on the outcome.
Best, Gabriel
On Wed, 2008-07-23 at 16:45 -0700, Andrew Straw wrote:
> Francesc Alted wrote:
> > Hi Gabriel,
> >
> > Your message has not entered the list properly and bounced (mail sent
> > from unsubscribed address?). I'm replying to it here.
> >
> > Gabriel J.L. Beckers wrote:
> >> Hi list,
> >
> >> In my code I would like to enforce the use of names that adhere to
> >> the natural naming principle of PyTables. But how to check this
> >> conveniently?
> >>
> >> I found the tables.checkNameValidity() function. However it raises an
> >> error if the name is not valid, and only prints a warning if it is
> >> not a valid natural name, and that only the first time it is used.
> >> Ideally I would like to use some function that checks whether or not
> >> an object/string is a valid natural name, and returns a False/True.
> >> Does something like that exist? Or can I somehow check for the
> >> warning that is raised?
> >
> > No, there is not a routine that does what you want. In fact, the
> > function ``tables.checkNameValidity()`` is only meant for internal use.
> > I think the routine that you need can be obtained quite easily from the
> > above one. Feel free to open a ticket so that I can track it later on
> > (if you end with an implementation, please attach it to the ticket).
> >
>
> Wouldn't this work?
>
> import warnings
> warnings.filterwarnings('error', category=tables.NaturalNameWarning)
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Pytables-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pytables-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users