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

Add dpgui entry point and dpgen gui CLI #1349

Merged
merged 6 commits into from Oct 9, 2023

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Oct 8, 2023

See deepmodeling/dpgui#270 for details.

njzjz and others added 6 commits October 6, 2023 22:34
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (8c47020) 48.64% compared to head (d6ee1e0) 48.62%.

❗ Current head d6ee1e0 differs from pull request most recent head 0851f48. Consider uploading reports for the commit 0851f48 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #1349      +/-   ##
==========================================
- Coverage   48.64%   48.62%   -0.02%     
==========================================
  Files          82       83       +1     
  Lines       14681    14693      +12     
==========================================
+ Hits         7141     7144       +3     
- Misses       7540     7549       +9     
Files Coverage Δ
dpgen/main.py 0.00% <0.00%> (ø)
dpgen/gui.py 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@njzjz njzjz marked this pull request as draft October 8, 2023 23:02
@njzjz
Copy link
Member Author

njzjz commented Oct 8, 2023

There seems to be an issue here. Python will dump NaN as {"type": NaN}. However, JavaScript doesn't think it a valid JSON string.

Python:

>>> import json
>>> json.dumps({"type":float("nan")})
'{"type": NaN}'

JavaScript:

> JSON.parse('{"type": NaN}')
VM1054:1 Uncaught SyntaxError: Unexpected token 'N', "{"type": NaN}" is not valid JSON
    at JSON.parse (<anonymous>)
    at <anonymous>:1:6

json.dumps(https://docs.python.org/3/library/json.html#json.dumps) has a allow_nan argument, but when it is False, an error is thrown.

@njzjz njzjz marked this pull request as ready for review October 9, 2023 00:07
@njzjz
Copy link
Member Author

njzjz commented Oct 9, 2023

Python will dump NaN as {"type": NaN}.

Finally, I changed NaN to 1e10 to avoid this issue.

@wanghan-iapcm wanghan-iapcm merged commit 2d317ca into deepmodeling:devel Oct 9, 2023
7 checks passed
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

2 participants