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

api: osrd_schemas: update rolling stock json schema for qualesi parameters #3811

Merged
merged 29 commits into from
May 22, 2023

Conversation

axrolld
Copy link
Contributor

@axrolld axrolld commented Apr 5, 2023

A proposal of evolution for railjson schema.

This will enable qualesi simulation (innovative trains) in OSRD.

Closes #3031

Payload to try to create a rs with energy_sources

 "energy_sources": [
        {
            "energy_source_type": "Catenary",
            "max_input_power": {
                "speeds": [
                    0,
                    5,
                    10,
                    15,
                    77
                ],
                "powers": [
                    441666.6666666667,
                    439473.6842105263,
                    435714.28571428574,
                    427777.77777777775,
                    400000
                ]
            },
            "max_output_power": {
                "speeds": [
                    0,
                    5,
                    10,
                    15,
                    77
                ],
                "powers": [
                    441666.6666666667,
                    439473.6842105263,
                    435714.28571428574,
                    427777.77777777775,
                    400000
                ]
            },
            "efficiency": 0.5
        },{
            "energy_source_type": "Battery",
            "max_input_power": {
                "speeds": [
                    0,
                    5,
                    10,
                    15,
                    77
                ],
                "powers": [
                    441666.6666666667,
                    439473.6842105263,
                    435714.28571428574,
                    427777.77777777775,
                    400000
                ]
            },
            "max_output_power": {
                "speeds": [
                    0,
                    5,
                    10,
                    15,
                    77
                ],
                "powers": [
                    441666.6666666667,
                    439473.6842105263,
                    435714.28571428574,
                    427777.77777777775,
                    400000
                ]
            },
            "efficiency": 0.5,
            "energy_storage": {
                "capacity": 100.0,
                "soc": 1.0,
                "soc_min": 0.5,
                "soc_max": 2.0,
                "refill_law": {
                    "tau": 0.5,
                    "soc_ref": 1.0
                }
            }
        },{
            "energy_source_type": "PowerPack",
            "max_input_power": {
                "speeds": [
                    0,
                    5,
                    10,
                    15,
                    77
                ],
                "powers": [
                    441666.6666666667,
                    439473.6842105263,
                    435714.28571428574,
                    427777.77777777775,
                    400000
                ]
            },
            "max_output_power": {
                "speeds": [
                    0,
                    5,
                    10,
                    15,
                    77
                ],
                "powers": [
                    441666.6666666667,
                    439473.6842105263,
                    435714.28571428574,
                    427777.77777777775,
                    400000
                ]
            },
            "efficiency": 0.5,
            "energy_storage": {
                "capacity": 100.0,
                "soc": 1.0,
                "soc_min": 0.5,
                "soc_max": 2.0,
                "refill_law": null
            }
        }
    ]

@axrolld axrolld changed the title Ard/update rs json schema qualesi Update rolling stock json schema for qualesi parameters Apr 5, 2023
@axrolld axrolld force-pushed the ard/update-rs-json-schema-qualesi branch 2 times, most recently from 9fbb337 to 0b646a4 Compare April 5, 2023 06:39
@clarani clarani force-pushed the ard/update-rs-json-schema-qualesi branch 2 times, most recently from 4e74b65 to 9e69f1b Compare April 5, 2023 09:10
@axrolld axrolld force-pushed the ard/update-rs-json-schema-qualesi branch from 6f4cf03 to 8b1cb58 Compare April 6, 2023 10:46
@clarani clarani changed the title Update rolling stock json schema for qualesi parameters api: osrd_schemas: update rolling stock json schema for qualesi parameters Apr 6, 2023
@clarani clarani added the area:api (deprecated) Work on Api Service (deprecated) label Apr 6, 2023
@clarani
Copy link
Contributor

clarani commented Apr 6, 2023

Maintainers: should we update the railjson version ?

@axrolld axrolld changed the title api: osrd_schemas: update rolling stock json schema for qualesi parameters Update rolling stock json schema for qualesi parameters Apr 6, 2023
@axrolld axrolld changed the title Update rolling stock json schema for qualesi parameters api: osrd_schemas: update rolling stock json schema for qualesi parameters Apr 6, 2023
@axrolld axrolld marked this pull request as ready for review April 6, 2023 13:51
@axrolld axrolld requested a review from a team as a code owner April 6, 2023 13:51
@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Merging #3811 (4a9b655) into dev (6b74631) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##                dev    #3811      +/-   ##
============================================
+ Coverage     20.34%   20.43%   +0.09%     
  Complexity     2007     2007              
============================================
  Files           815      815              
  Lines         80480    80575      +95     
  Branches       2088     2088              
============================================
+ Hits          16374    16468      +94     
- Misses        62919    62920       +1     
  Partials       1187     1187              
Flag Coverage Δ
editoast 75.68% <100.00%> (+<0.01%) ⬆️
front 8.68% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
editoast/src/schema/rolling_stock/mod.rs 87.50% <ø> (ø)
editoast/src/tables.rs 0.00% <ø> (ø)
...st/src/models/rolling_stock/light_rolling_stock.rs 97.14% <100.00%> (+0.08%) ⬆️
editoast/src/models/rolling_stock/mod.rs 92.85% <100.00%> (+0.17%) ⬆️
editoast/src/views/rolling_stocks.rs 59.74% <100.00%> (+0.79%) ⬆️
front/src/common/api/osrdEditoastApi.ts 91.61% <100.00%> (+0.27%) ⬆️
front/src/common/api/osrdMiddlewareApi.ts 91.82% <100.00%> (+0.33%) ⬆️

... and 2 files with indirect coverage changes

@clarani clarani force-pushed the ard/update-rs-json-schema-qualesi branch 5 times, most recently from 537e324 to 9c73f67 Compare April 7, 2023 10:46
@clarani clarani requested a review from eckter as a code owner April 7, 2023 10:46
Copy link
Contributor

@flomonster flomonster left a comment

Choose a reason for hiding this comment

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

You forgot to adapt the RS schema of editoast.

@axrolld axrolld force-pushed the ard/update-rs-json-schema-qualesi branch from 1f52188 to b660fcf Compare April 7, 2023 13:19
@clarani clarani force-pushed the ard/update-rs-json-schema-qualesi branch 4 times, most recently from 28391c9 to 6843575 Compare April 7, 2023 15:37
@anisometropie anisometropie force-pushed the ard/update-rs-json-schema-qualesi branch from 449d819 to f25e325 Compare April 18, 2023 12:59
@clarani clarani force-pushed the ard/update-rs-json-schema-qualesi branch 3 times, most recently from 4104d1b to ab120a6 Compare April 25, 2023 09:26
@clarani clarani force-pushed the ard/update-rs-json-schema-qualesi branch from ded947f to 4a9b655 Compare May 22, 2023 09:14
@clarani clarani enabled auto-merge (squash) May 22, 2023 09:15
@clarani clarani merged commit 862f2db into dev May 22, 2023
@clarani clarani deleted the ard/update-rs-json-schema-qualesi branch May 22, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api (deprecated) Work on Api Service (deprecated)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt Rollingstock model from Qualesi to OSRD
6 participants