Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename CNodes as LNodes, add typing, process AST separately from creating it. #594

Merged
merged 13 commits into from
Sep 4, 2023

Conversation

chrisrichardson
Copy link
Contributor

This PR adresses removes CNodes, and replaces with a much slimmed-down "LNodes" which contains the basics:

  • Variables and Arrays of Scalar (same as tensor), Real (same as geometry) and Int
  • Basic math operations +-*/
  • Math functions, including conditional statements
  • ForRange loops

but removes almost everything else.

  • All Symbols must now have a DataType

Additionally, the Abstract Syntax Tree (AST) which is generated is now processed separately in c_implementation.py, which will allow us to post-process into other languages/libraries in the future.

This is quite a large PR, unfortunately, but I think it will move things in the right direction.

@chrisrichardson chrisrichardson marked this pull request as ready for review August 28, 2023 09:21
@coveralls
Copy link

coveralls commented Aug 29, 2023

Coverage Status

coverage: 76.575% (-2.0%) from 78.566% when pulling 5198ba6 on chris/lnodes into 4572bec on main.

@chrisrichardson
Copy link
Contributor Author

I just added some formatting for complex numbes and variable precision. Standard C needs the 1.0+1.0*I rather than 1.0+1.0j although modern compilers seem to accept either.

@chrisrichardson chrisrichardson merged commit 52bcbe4 into main Sep 4, 2023
11 checks passed
@chrisrichardson chrisrichardson deleted the chris/lnodes branch September 4, 2023 14:33
jorgensd added a commit to jorgensd/cbcbeatx that referenced this pull request Sep 5, 2023
chrisrichardson added a commit that referenced this pull request Sep 5, 2023
* add brackets for neg

* Add test
@garth-wells garth-wells mentioned this pull request Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants