Comments (5)
Thanks for the bug report. This should be fairly simple to fix in the parser. I would probably map these complex numbers to System.Runtime.Numerics.Complex
from pytocs.
I've fixed the error for 1e3000000
on my machine. The Python lexer was incorrectly parsing it as two separate tokens, 1e30
and 00000
. Now another issue is uncovered: the 1e3000000
will not fit into an IEEE 785 64-bit floating point number by a overwhelming margin. This number is so large that it either requires "BigFloat" support, or should overflow into System.Double.PositiveInfinity
. What do you think should happen here?
While waiting for your answer, I will work on handling j
.
from pytocs.
Great news. Thanks for the very fast response.
I think, the 1e300000 is a bad habit from the developer. Because in the source checking the infinity value. But the python is very forgiving. :)
This is not my source, i just try to translate to C#.
from pytocs.
I've read further and discovered that the 1e300000
was a recommended idiom not too long ago: today you're expected to write float('+inf')
. I have written logic in pytocs
to handle this and will be pushing it shortly.
from pytocs.
pytocs
no longer crashes when processing your submitted Python files. I also threw in some more conversion code to handle the Python complex()
built-in function.
from pytocs.
Related Issues (20)
- Convert a folder with PyTorch Jupyter Nodebooks HOT 3
- error, colon missing, convert the [:,t,:] syntax of python language into C#
- pytocs does not work HOT 2
- Add Github label: Torchsharp
- pytocs "d_keys = d_keys or (d_model//n_heads)" iserror
- Compiling to Release - Pound symbol in string literal HOT 1
- [WIP: Help] PyTorch to TorchSharp: the python way HOT 1
- The UI crashes on Windows 11 when browsing HOT 2
- can't build for VS2022 and .net 6 HOT 3
- Recognize `@abstractmethod` attribute
- Recognize constant negative list indices
- Translate `is None` to `is null`
- parser error Expected token type NEWLINE but saw ID. HOT 1
- pytocs 6.0 cli exception HOT 1
- 2.0.1 Errors Unexpected token {OP_GT} and Expected token type ID but saw LPAREN. HOT 2
- Add this class when meeting math
- csharp Keywords HOT 2
- change "void" to "object"
- parser error. Expected token type NEWLINE but saw AT. HOT 2
- parser error. More than one keyword argument specifier. HOT 1
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 pytocs.