Comments (8)
I will test this and once we have more data we can think about what we do with it.
from parselglossy.
After a bit of reading (in particular https://docs.python.org/3/library/json.html#implementation-limitations), we can expect the serialized data to contain the same range and precision as the Python data types. But whether we lose the range and precision depends on who is reading the JSON.
If Python, my guess is that there is no significant loss. But with other JSON implementations, I guess it depends.
from parselglossy.
I also tested this locally Python -> JSON -> Python. But I haven't tested reading into another language with another implementation.
from parselglossy.
@stigrj can you run some tests in cpp-parselglossy? We need to check this also for the Fortran and C examples. If those JSON libraries do not present this problem, then I think we can document our preference for the JSON libraries for compiled languages and warning people about this possible pitfall with libraries we have not personally tested.
On a different note, I've never set a floating point parameter in an input file that employed the full range and precision... Any other input parser would hit the same problem, I think.
from parselglossy.
I also think that this is not a JSON-specific problem but basically a problem of reading a number from file. We should check how C and Fortran read floats, testing both range and precision.
from parselglossy.
from parselglossy.
Where will we document our findings? On the lib side or the tutorial side?
from parselglossy.
A mention on both sides seems the safest bet.
from parselglossy.
Related Issues (20)
- GitHub Action producin PyPI package does not trigger on release HOT 13
- Input parsing is silent on some type errors HOT 3
- Whitespace and newlines in coordinate sections between content and $end is not stripped HOT 1
- Add a Path type HOT 2
- JOSS paper HOT 2
- Deprecation mechanism for sections or keywords HOT 4
- Arbitrary callbacks on the input tree HOT 5
- pydantic for validation HOT 2
- Circular dependencies in default and predicate callables? HOT 7
- Improve design documentation HOT 1
- Add page linking to codes using parselglossy HOT 3
- Chain of dependencies HOT 12
- Document how to use grammar specifications different from packaged ones HOT 4
- --doctest-module flag is not recognized HOT 2
- Multiple definitions of keywords HOT 3
- Reactivate macOS builds HOT 2
- Not sure how to run the script/generator HOT 5
- Fix the PyPI deploy step HOT 1
- Consider adding Union type HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parselglossy.