--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
# For compatibility with 1.8
import pg8000 as dbapi
DBAPI = dbapi
pg8000_dbapi = DBAPI
Including contrib in sys.path would be interesting but there could be collisions (for example, in this case, witch pg8000 will be imported: the one installed or the one in gluon.contrib?)
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/BfSIbUSPk38/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Niphlod,
I tried using psycopg2 but there are few reasons because of which I can not use it. I am currently deploying travis CI to run Sahana Eden unit tests. psycopg2 fails a few of the tests which it really should not. You can see the build here [1].
26.0729016786571 != 26.072901678657075
let's confront them carefully...
26.0729016786571
26.072901678657075
yep. psycopg2 returns the same value than pg8000, only with a lesser precision, estimated in roughly...wait, let's do calcs.
26.07291 to 26.07292 equals to 1 meter. Every digit you loose in precision, adds up roughly to an order of magnitude...
meaning 26.0729 to 26.0730 equals 10 meters.
sahana's tests are complaining about a difference of .... well, much more LESS than the dimension a grain of salt (actually, a lot less).
If sahana is not trying to tie gps coordinates to atoms, psycopg2 is not the problem, sahana's tests are....
the whole concept is even more ridicolous because making tests with FIXED float values is the worst idea ever, especially
considering that at this level of precision, even your python code can't tell the difference ...>>> testvalue = 26.072901678657075
>>> print testvalue
26.0729016787
>>> testvalue2 = 26.0729016786570754
>>> testvalue == testvalue2
True
On Tuesday, October 14, 2014 11:50:45 PM UTC+2, ArnvShrma wrote:
Hi Niphlod,
I tried using psycopg2 but there are few reasons because of which I can not use it. I am currently deploying travis CI to run Sahana Eden unit tests. psycopg2 fails a few of the tests which it really should not. You can see the build here [1].
web2py does not maintain pg8000 (although its developer is a contributor to web2py's code). Contact him about the issue on the json type.
Also, it seems that most of the errors (web2py doesn't maintain Sahana Eden either, and I'm not a developer or Sahana Eden) comes from lat/long differences from fixed values (again, probably, related from a quick copy/paste unittest suite than a carefully built one)
If only people could READ unittests instead of pointing out failing ones as actual failures....world will have less headaches.
E.g.:26.0729016786571 != 26.072901678657075
let's confront them carefully...
26.0729016786571
26.072901678657075
yep. psycopg2 returns the same value than pg8000, only with a lesser precision, estimated in roughly...wait, let's do calcs.
26.07291 to 26.07292 equals to 1 meter. Every digit you loose in precision, adds up roughly to an order of magnitude...
meaning 26.0729 to 26.0730 equals 10 meters.
sahana's tests are complaining about a difference of .... well, much more LESS than the dimension a grain of salt (actually, a lot less).
If sahana is not trying to tie gps coordinates to atoms, psycopg2 is not the problem, sahana's tests are.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/BfSIbUSPk38/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
db._adapter.types['JSON'] = 'TEXT'
if self.driver_name == "pg8000":
supports_json = self.connection.server_version >= "9.2.0"
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.