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

Reflactor: new json array support and add json tree of abacus-output #3687

Merged
merged 21 commits into from Mar 22, 2024

Conversation

grysgreat
Copy link
Collaborator

@grysgreat grysgreat commented Mar 5, 2024

Linked Issue

Fix #3686
Fix #3705

What's changed?

  • Add new json array support.
  • Change old add_json function: support array index in number instead of string.
  • Add json part of abacus - output.
  • Adjust old add_json function into new add_Json

@grysgreat
Copy link
Collaborator Author

Now we can add json array in this way:

    Json::AbacusJson::add_json({"array","1","new_add_notLast"}, "correct1",false);
    Json::AbacusJson::add_json({"array","0","new_add_Last"}, "correct2",false);

where "0" means add in the last position. Other is the array index(start by 1).

@pxlxingliang
Copy link
Collaborator

Please add some comments to explain how to use the add_json function.

@grysgreat
Copy link
Collaborator Author

grysgreat commented Mar 5, 2024

Please add some comments to explain how to use the add_json function.

Comments in the code are added in [abacusjson.h] now .

@grysgreat grysgreat changed the title Reflactor new json array support. Reflactor: new json array support and add json tree of abacus-output Mar 13, 2024
@grysgreat
Copy link
Collaborator Author

grysgreat commented Mar 14, 2024

New json file is as follow.

Run calculate case of examples/relax/pw_al.

abacus.json

source/module_io/json_output/abacusjson.h Outdated Show resolved Hide resolved
source/module_io/json_output/abacusjson.h Outdated Show resolved Hide resolved
source/module_relax/relax_driver.cpp Show resolved Hide resolved
@grysgreat
Copy link
Collaborator Author

Now add new implementation of add_json function by custom heterogeneous containers.

eg.

Json::AbacusJson::add_json({"key",0}, 4,true);

Copy link
Collaborator

@WHUweiqingzhou WHUweiqingzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@pxlxingliang pxlxingliang merged commit 0c42fb9 into deepmodeling:develop Mar 22, 2024
12 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
3 participants