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

Revise JSON format #403

Open
efaulhaber opened this issue Feb 27, 2024 · 0 comments
Open

Revise JSON format #403

efaulhaber opened this issue Feb 27, 2024 · 0 comments

Comments

@efaulhaber
Copy link
Member

The current JSON format is

{
    "meta": {
        "julia_version": "1.10.1",
        "solver_version": "c6184f4-dirty",
        "solver_name": "TrixiParticles.jl"
    },
    "mid_point_y_solid_1": {
        "n_values": 4,
        "time": [
            0.0,
            0.01,
            0.02,
            0.03,
        ],
        "system_name": "solid",
        "values": [
            0.01,
            0.009900000027477278,
            0.009598224579854263,
            0.009120736097874588,
        ],
        "datatype": "Float64",
        "type": "series"
    },
    "mid_point_x_solid_1": {
        "n_values": 4,
        "time": [
            0.0,
            0.01,
            0.02,
            0.03,
        ],
        "system_name": "solid",
        "values": [
            0.4,
            0.39999999975087647,
            0.3999997685917326,
            0.3999980137707291,
        ],
        "datatype": "Float64",
        "type": "series"
    }
}

For large files, there are a lot of duplicate time vectors. I suggest we extract the time to only have it once. So I guess as data["time"] or so.

Also, wouldn't it be nicer to do data["fluid_1"]["pressure"]["values"] instead of data["pressure_fluid_1"]["values"]?
Then I suggest the following format (open for discussion):

{
    "meta": {
        "julia_version": "1.10.1",
        "solver_version": "c6184f4-dirty",
        "solver_name": "TrixiParticles.jl"
    },
    "time": {
        "n_valus": 4,
        "values": [
            0.0,
            0.01,
            0.02,
            0.03,
        ],
        "datatype": "Float64",
        "type": "series",
    },
    "solid_1": {
        "mid_point_y": {
            "n_values": 4,
            "values": [
                0.01,
                0.009900000027477278,
                0.009598224579854263,
                0.009120736097874588,
            ],
            "datatype": "Float64",
            "type": "series",
        },
        "mid_point_x": {
            "n_values": 4,
            "values": [
                0.4,
                0.39999999975087647,
                0.3999997685917326,
                0.3999980137707291,
            ],
            "datatype": "Float64",
            "type": "series"
        },
    },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant