Re: [fixed] signed char is greater than maximum

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fixed] signed char is greater than maximum

GRAMPS - Dev mailing list

--------------------------------------------
En date de : Dim 2.7.17, jerome via Gramps-devel <[hidden email]> a écrit :

 Objet: Re: [Gramps-devel] signed char is greater than maximum
 À: "John Ralls" <[hidden email]>
 Cc: "[hidden email]" <[hidden email]>
 Date: Dimanche 2 juillet 2017, 10h07
 
 
 --------------------------------------------
 En date de : Sam 1.7.17, John Ralls
 <[hidden email]>
 a écrit :
 
  Objet: Re: [Gramps-devel] signed char
 is greater than maximum
  À: "jerome" <[hidden email]>
  Cc: "[hidden email]"
 <[hidden email]>
  Date: Samedi 1 juillet 2017, 17h14
 
 
 > > The
  code[1] is something like:
 > >
 > > from array import array
 > >
 > >             
    # sometimes 'iterator' (generator)
 is more
  faster
 > >               
  #handle_list = map(handle,
 filtered_list)
 > >               
 iterator = (handle
  for handle in filtered_list)
 > >
 > >             
  new_list=[int(kekule), int(Ga),
 int(Gb), int(mra),
  int(rank)]
 > >              
 line =
  (iterator, array('b', new_list))
 > >
 > >
 > > [1] https://github.com/gramps-project/addons-source/blob/maintenance/gramps42/RelID/Relation_tab.py#L270
 
 > Jérôme,
 
 > The error that you’re trying
 > to stuff an int into a byte
 (“char” is the C type name
 > for an 8-bit int). That works as
 long as the int is between
 > -127 and 128 but will raise that
 error if it’s larger.
 >
 > What do you have in mind for
 > “line”? It seems unlikely that
 smooshing 4 ints into a
 > single byte array is going to be
 useful.
 >
 > Regards,
 > John
 > Ralls
 
 John,
 
Yes, I got it.

I am now able to reproduce it.
Thanks.

Well, it will raise an error after the 7th generation,
which starts with sosa/kekule number = "128" ... ;-)
Yes, need a proper (right) way than current code for this variable.

Note, the user (see user-mailing list) is now able to run
the tool. I need to also polish some sections or make
some column headers clearer.

Maybe a useful plugin might be rather a view (the current output is close to a view).
I am thinking on new view for current "Relations" category.

There is a small documentation on addon hosting
https://github.com/gramps-project/addons-source/tree/master/RelID
maybe I should add some screenshots too?


Thanks.
Jérôme


 
 ------------------------------------------------------------------------------
 Check out the vibrant tech community on
 one of the world's most
 engaging tech sites, Slashdot.org! http://sdm.link/slashdot
 _______________________________________________
 Gramps-devel mailing list
 [hidden email]
 https://lists.sourceforge.net/lists/listinfo/gramps-devel
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fixed] signed char is greater than maximum

John Ralls-2


On Jul 2, 2017, at 6:38 AM, jerome <[hidden email]> wrote:


--------------------------------------------
En date de : Dim 2.7.17, jerome via Gramps-devel <[hidden email]> a écrit :

Objet: Re: [Gramps-devel] signed char is greater than maximum
À: "John Ralls" <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Date: Dimanche 2 juillet 2017, 10h07


--------------------------------------------
En date de : Sam 1.7.17, John Ralls
<[hidden email]>
a écrit :

 Objet: Re: [Gramps-devel] signed char
is greater than maximum
 À: "jerome" <[hidden email]>
 Cc: "[hidden email]"
<[hidden email]>
 Date: Samedi 1 juillet 2017, 17h14


The
 code[1] is something like:

from array import array

             
   # sometimes 'iterator' (generator)
is more
 faster
               
 #handle_list = map(handle,
filtered_list)
               
iterator = (handle
 for handle in filtered_list)

             
 new_list=[int(kekule), int(Ga),
int(Gb), int(mra),
 int(rank)]
              
line =
 (iterator, array('b', new_list))


[1] https://github.com/gramps-project/addons-source/blob/maintenance/gramps42/RelID/Relation_tab.py#L270

Jérôme,

The error that you’re trying
to stuff an int into a byte
(“char” is the C type name
for an 8-bit int). That works as
long as the int is between
-127 and 128 but will raise that
error if it’s larger.

What do you have in mind for
“line”? It seems unlikely that
smooshing 4 ints into a
single byte array is going to be
useful.

Regards,
John
Ralls

John,

Yes, I got it.

I am now able to reproduce it.
Thanks.

Well, it will raise an error after the 7th generation,
which starts with sosa/kekule number = "128" ... ;-)
Yes, need a proper (right) way than current code for this variable.

Note, the user (see user-mailing list) is now able to run
the tool. I need to also polish some sections or make
some column headers clearer.

Maybe a useful plugin might be rather a view (the current output is close to a view).
I am thinking on new view for current "Relations" category.

There is a small documentation on addon hosting
https://github.com/gramps-project/addons-source/tree/master/RelID
maybe I should add some screenshots too?

I’d think that a paragraph or two explaining what the add-on actually does is needed more than screenshots.

In addition to regular ahnentafel numbering you might consider ancestral line numbering, see https://gramps-project.org/bugs/view.php?id=5468. Capers told me at the NGS conference this spring that he had let the patent lapse, so there’s no longer any obstacle to using it in Gramps.

Regards,
John Ralls

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fixed] signed char is greater than maximum

GRAMPS - Dev mailing list
In reply to this post by GRAMPS - Dev mailing list
John,
 

> I’d think that a paragraph or two
> explaining what the add-on actually does is needed more than
> screenshots.
> In addition to regular ahnentafel
> numbering you might consider ancestral line numbering,
> see https://gramps-project.org/bugs/view.php?id=5468.
> Capers told me at the NGS conference this spring that he had
> let the patent lapse, so there’s no longer any obstacle to
> using it in Gramps.
> Regards,John Ralls

Such high-level project could be a little bit too complex for my current
testing! Anyway, as current 'number.py' is still yet very basic, it should not be
difficult to include more complex code on this module, maybe based on this
work?
 
True, my starting point was related to ahnentafel numbering, but
this numbering will not match whatever relation(s) between two people.
It is often designed for blood relation and it seems "too" gender oriented (male).
So, currently, many exceptions (extensions, custom stuff) are used on the addon.

Like with my current workaround for fixing the mistake (just used
long with array if need an integer greater then 128...), it is experimentation,
so I only looked what could be used for a quick alternate data representation.
Also, I am not happy with some "non-birth" and "cousin" numbering(s).

The experimentation around array is rather related to a possible quick
binary tree (more and less based on some definitions available
on the "binary tree" wikipedia page) and distance(s) between two people.

So, it is a rather a mixup of numbering stuff (not only ancestors by birth)
and just yet another data representation!

Regards,
Jérôme R.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Loading...