-
Notifications
You must be signed in to change notification settings - Fork 11
Feature: Upload external resources #1492
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
733bf31
fix collapse clickthrough
duranb c879818
move scheduling enum file to enums directory
duranb 745ebdb
Add ability to upload external dataset to plan
duranb 88572c3
add ability to associate simulation dataset to external datasets
duranb 5f65006
styling
duranb 8084ce4
add e2e tests for dataset uploading
duranb 3e2a469
update design
duranb 8ef04e5
add toasts for external dataset upload
duranb 9e24ad6
cleanup
duranb 24c1d6c
ensure unique resource name
duranb db9a645
add styling
duranb 7c08db8
fix unique profile names
duranb 86df418
fix styling
duranb ad67784
fix test
duranb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| time_utc,TotalPower,BatteryStateOfCharge,Temperature | ||
| 2024-245T00:01:00.0,0.0,143.15,0.0 | ||
| 2024-245T00:02:00.0,384.999999940483,1.4,-12.0964867663028 | ||
| 2024-245T00:03:00.0,384.999999399855,137.45,-12.0974993557598 | ||
| 2024-245T00:04:00.0,385.000010807604,134.85,-12.0985125609155 | ||
| 2024-245T00:05:00.0,381.80000002749,132.4,-12.0995253838464 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| { | ||
| "datasetStart": "2024-245T14:00:00", | ||
| "profileSet": { | ||
| "/awake": { | ||
| "schema": { | ||
| "type": "string" | ||
| }, | ||
| "segments": [ | ||
| { | ||
| "duration": 3000000000, | ||
| "dynamics": "foo" | ||
| }, | ||
| { | ||
| "duration": 3000000000, | ||
| "dynamics": "bar" | ||
| } | ||
| ], | ||
| "type": "discrete" | ||
| }, | ||
| "/batteryEnergy": { | ||
| "schema": { | ||
| "items": { | ||
| "initial": { | ||
| "type": "real" | ||
| }, | ||
| "rate": { | ||
| "type": "real" | ||
| } | ||
| }, | ||
| "type": "struct" | ||
| }, | ||
| "segments": [ | ||
| { | ||
| "duration": 40000000, | ||
| "dynamics": { | ||
| "initial": 100, | ||
| "rate": -0.5 | ||
| } | ||
| }, | ||
| { | ||
| "duration": 30000000, | ||
| "dynamics": { | ||
| "initial": 35, | ||
| "rate": -0.1 | ||
| } | ||
| } | ||
| ], | ||
| "type": "real" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import test, { expect, type BrowserContext, type Page } from '@playwright/test'; | ||
| import { Constraints } from '../fixtures/Constraints.js'; | ||
| import { Models } from '../fixtures/Models.js'; | ||
| import { Plan } from '../fixtures/Plan.js'; | ||
| import { Plans } from '../fixtures/Plans.js'; | ||
| import { SchedulingConditions } from '../fixtures/SchedulingConditions.js'; | ||
| import { SchedulingGoals } from '../fixtures/SchedulingGoals.js'; | ||
|
|
||
| let constraints: Constraints; | ||
| let context: BrowserContext; | ||
| let models: Models; | ||
| let page: Page; | ||
| let plan: Plan; | ||
| let plans: Plans; | ||
| let schedulingConditions: SchedulingConditions; | ||
| let schedulingGoals: SchedulingGoals; | ||
|
|
||
| test.beforeAll(async ({ baseURL, browser }) => { | ||
| context = await browser.newContext(); | ||
| page = await context.newPage(); | ||
|
|
||
| models = new Models(page); | ||
| plans = new Plans(page, models); | ||
| constraints = new Constraints(page); | ||
| schedulingConditions = new SchedulingConditions(page); | ||
| schedulingGoals = new SchedulingGoals(page); | ||
| plan = new Plan(page, plans, constraints, schedulingGoals, schedulingConditions); | ||
|
|
||
| await models.goto(); | ||
| await models.createModel(baseURL); | ||
| await plans.goto(); | ||
| await plans.createPlan(); | ||
| await plan.goto(); | ||
| }); | ||
|
|
||
| test.afterAll(async () => { | ||
| await plans.goto(); | ||
| await plans.deletePlan(); | ||
| await models.goto(); | ||
| await models.deleteModel(); | ||
| await page.close(); | ||
| await context.close(); | ||
| }); | ||
|
|
||
| test.describe.serial('Plan Resources', () => { | ||
| test('Uploading external plan dataset file - JSON', async () => { | ||
| await plan.uploadExternalDatasets('e2e-tests/data/external-dataset.json'); | ||
| await expect(plan.panelActivityTypes.getByText('/awake')).toBeVisible(); | ||
| await expect(plan.panelActivityTypes.getByText('/batteryEnergy')).toBeVisible(); | ||
| }); | ||
|
|
||
| test('Uploading external plan dataset file - CSV', async () => { | ||
| await plan.uploadExternalDatasets('e2e-tests/data/external-dataset.csv'); | ||
| await expect(plan.panelActivityTypes.getByText('TotalPower')).toBeVisible(); | ||
| await expect(plan.panelActivityTypes.getByText('BatteryStateOfCharge')).toBeVisible(); | ||
| await expect(plan.panelActivityTypes.getByText('Temperature')).toBeVisible(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
AaronPlave marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.