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

0.9.0rc0 build updates #46

Merged
merged 46 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b3df68c
build workflow
MichaelPesce Nov 16, 2022
ecb90e3
build workflow
MichaelPesce Nov 16, 2022
f4e68ef
build workflow
MichaelPesce Nov 16, 2022
65d4688
Merge branch 'project-pareto:main' into build
MichaelPesce Nov 17, 2022
bdeb619
Merge branch 'main' of https://github.com/MichaelPesce/pareto-ui into…
MichaelPesce Nov 18, 2022
2e22495
Merge branch 'main' of https://github.com/MichaelPesce/pareto-ui into…
MichaelPesce Nov 21, 2022
923cc54
merging main in
MichaelPesce Dec 1, 2022
99e5820
Merge branch 'main' of https://github.com/MichaelPesce/pareto-ui into…
MichaelPesce Dec 2, 2022
f9c837f
build
MichaelPesce Dec 2, 2022
6d25fb4
merged main in
MichaelPesce Dec 5, 2022
cbe0bdb
gurobipy build
MichaelPesce Dec 5, 2022
7324c0f
build portable app?
MichaelPesce Sep 13, 2023
903fc3f
update artifat name
MichaelPesce Sep 13, 2023
924cbf5
update version number to match artifact name
MichaelPesce Sep 13, 2023
f3d8ce8
try build portable again
MichaelPesce Sep 13, 2023
768b10a
print out file directory to see what the installer is being created as
MichaelPesce Sep 13, 2023
5138133
update artifact name
MichaelPesce Sep 13, 2023
a58ec80
try again
MichaelPesce Sep 13, 2023
5fb8ba6
merge main in
MichaelPesce Sep 27, 2023
052a2f0
change v number to 23.09.27
MichaelPesce Sep 27, 2023
1a3beef
portable build
MichaelPesce Sep 27, 2023
7194428
display files in workflow
MichaelPesce Sep 27, 2023
efbc5d5
portable build with correct v number
MichaelPesce Sep 27, 2023
222059b
0.9.0rc0 build
MichaelPesce Sep 27, 2023
89cef0b
0.9.0rc0 build
MichaelPesce Sep 27, 2023
372e9fa
0.9.0rc0 build portable
MichaelPesce Sep 27, 2023
8b3f66f
0.9.0rc0 build portable
MichaelPesce Sep 27, 2023
92c9f40
0.9.0rc0 build
MichaelPesce Sep 27, 2023
a96aa09
try numpy 1.24.3 for windows build; update landing page version text …
MichaelPesce Sep 27, 2023
6b232d5
build portable
MichaelPesce Sep 27, 2023
6dd3c2c
change pandas version for mac
MichaelPesce Sep 28, 2023
ff2b933
add new beneficial reuse tabs; update names dictionary for new inputs…
MichaelPesce Sep 28, 2023
c59729d
run build (installer version)
MichaelPesce Sep 28, 2023
492a3bf
run build (portable version; 0.9.0rc0)
MichaelPesce Sep 28, 2023
b801bbc
run build (installer version; 0.9.0rc0)
MichaelPesce Sep 28, 2023
c732272
fix bug when updating excel float values
MichaelPesce Sep 28, 2023
0cad77c
update v number, run portable build
MichaelPesce Sep 28, 2023
7da6620
run installer version build
MichaelPesce Sep 28, 2023
a19270f
fix first time value on charts
MichaelPesce Oct 2, 2023
af441f0
add filter dropdown for water qualitty chart, still needs proper data
MichaelPesce Oct 2, 2023
10aeea1
add node filter data for water quality chart
MichaelPesce Oct 3, 2023
a5d56e0
added new diagrams for 3 workshop scenarios; updated v number
MichaelPesce Oct 5, 2023
5a529ac
run portable build
MichaelPesce Oct 5, 2023
0ef8359
run nsis build
MichaelPesce Oct 5, 2023
8a2e021
add new images as data files for build; update v number; run portable…
MichaelPesce Oct 6, 2023
b693db0
run nsis build
MichaelPesce Oct 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: App build
on:
push:
branches:
- "september-updates"
- "build"

defaults:
run:
Expand Down Expand Up @@ -45,11 +45,15 @@ jobs:

# - name: Install Pareto locally
# working-directory: ../
# run: git clone https://github.com/MichaelPesce/project-pareto.git && cd project-pareto && git fetch --all && git checkout 0.5.0_release && pip install --progress-bar off .
# run: git clone https://github.com/MichaelPesce/project-pareto.git && cd project-pareto && pip install --progress-bar off .

- name: Install Pareto locally
working-directory: ../
run: git clone https://github.com/project-pareto/project-pareto.git && cd project-pareto && git fetch --all --tags && git checkout 0.8.0 && pip install --progress-bar off .
run: git clone https://github.com/project-pareto/project-pareto.git && cd project-pareto && git fetch --all --tags && git checkout 0.9.0rc0 && pip install --progress-bar off .

- name: Install numpy 1.24.3
run: |
pip uninstall -y numpy && pip install numpy==1.24.3

- name: Build Backend
run: npm --prefix electron run build-backend
Expand All @@ -60,17 +64,20 @@ jobs:
- name: Build Windows Distribution
run: npm --prefix electron run electron-build-win

- name: Display file names
run: cd electron && cd dist && ls

- name: Sign Windows Distribution
run: |
AzureSignTool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v electron/dist/ParetoUI-09.19.23-win64.exe
AzureSignTool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v electron/dist/ParetoUI-23.10.06-win64.exe

- name: Upload artifact for windows build
uses: actions/upload-artifact@v3
if: always()
with:
name: windows-pareto-dist
path: |
electron/dist/ParetoUI-09.19.23-win64.exe
electron/dist/ParetoUI-23.10.06-win64.exe
# windows-build:
# name: Windows Build

Expand Down Expand Up @@ -119,4 +126,4 @@ jobs:
# with:
# name: windows-pareto-dist
# path: |
# electron/dist/ParetoUI-09.19.23-win64.exe
# electron/dist/ParetoUI-23.10.06-win64.exe
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pip uninstall -y numpy pandas
Install arm64 versions of numpy and pandas:

```sh
conda install -y -c conda-forge/osx-arm64 numpy pandas=1.5.3
conda install -y -c conda-forge/osx-arm64 numpy pandas=1.4.0
```


Expand Down
8 changes: 8 additions & 0 deletions backend/app/extra-hooks/hook-pareto.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@
datas.append(('internal/assets/DisposalOverrideInput.png', 'app/internal/assets'))
datas.append(('internal/assets/SRAInput.png', 'app/internal/assets'))

# add workshop pngs
datas.append(('internal/assets/workshop_baseline_input.png', 'app/internal/assets'))
datas.append(('internal/assets/workshop_baseline_output.png', 'app/internal/assets'))
datas.append(('internal/assets/workshop_SRA_input.png', 'app/internal/assets'))
datas.append(('internal/assets/workshop_SRA_output.png', 'app/internal/assets'))
datas.append(('internal/assets/workshop_beneficial_reuse_input.png', 'app/internal/assets'))
datas.append(('internal/assets/workshop_beneficial_reuse_output.png', 'app/internal/assets'))

print(datas)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 36 additions & 10 deletions backend/app/internal/scenario_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,24 @@ def update_scenario(self, updatedScenario):
new_input_diagram_path = f"{self.input_diagrams_path}/{id_}.{input_diagramFileType}"
shutil.copyfile(original_input_diagram_path, new_input_diagram_path)
updatedScenario[f'inputDiagramExtension'] = 'png'
if newName.upper() == "WORKSHOP BASELINE" and oldName.upper() != "WORKSHOP BASELINE":
input_diagramFileType = 'png'
original_input_diagram_path = f'{os.path.dirname(os.path.abspath(__file__))}/assets/workshop_baseline_input.png'
new_input_diagram_path = f"{self.input_diagrams_path}/{id_}.{input_diagramFileType}"
shutil.copyfile(original_input_diagram_path, new_input_diagram_path)
updatedScenario[f'inputDiagramExtension'] = 'png'
if newName.upper() == "WORKSHOP SRA" and oldName.upper() != "WORKSHOP SRA":
input_diagramFileType = 'png'
original_input_diagram_path = f'{os.path.dirname(os.path.abspath(__file__))}/assets/workshop_SRA_input.png'
new_input_diagram_path = f"{self.input_diagrams_path}/{id_}.{input_diagramFileType}"
shutil.copyfile(original_input_diagram_path, new_input_diagram_path)
updatedScenario[f'inputDiagramExtension'] = 'png'
if newName.upper() == "WORKSHOP BENEFICIAL REUSE" and oldName.upper() != "WORKSHOP BENEFICIAL REUSE":
input_diagramFileType = 'png'
original_input_diagram_path = f'{os.path.dirname(os.path.abspath(__file__))}/assets/workshop_beneficial_reuse_input.png'
new_input_diagram_path = f"{self.input_diagrams_path}/{id_}.{input_diagramFileType}"
shutil.copyfile(original_input_diagram_path, new_input_diagram_path)
updatedScenario[f'inputDiagramExtension'] = 'png'
except:
_log.error('unable to check and/or replace input diagram for SRA')

Expand Down Expand Up @@ -264,15 +282,21 @@ def check_for_diagram(self, id, filename = None):
diagramIdentifier = scenario['name']
scenario_diagram_path = f"{self.output_diagrams_path}/{id}.{extension}"
try:
diagram_path = files('pareto').parent.joinpath(f"docs/img/{diagramIdentifier}.{extension}")
if scenario['name'].upper() == "WORKSHOP BASELINE":
diagram_path = f'{os.path.dirname(os.path.abspath(__file__))}/assets/workshop_baseline_{diagramType}.png'
elif scenario['name'].upper() == "WORKSHOP SRA":
diagram_path = f'{os.path.dirname(os.path.abspath(__file__))}/assets/workshop_sra_{diagramType}.png'
elif scenario['name'].upper() == "WORKSHOP BENEFICIAL REUSE":
diagram_path = f'{os.path.dirname(os.path.abspath(__file__))}/assets/workshop_beneficial_reuse_{diagramType}.png'
else:
diagram_path = files('pareto').parent.joinpath(f"docs/img/{diagramIdentifier}.{extension}")
_log.info(f'diagram_path is : {diagram_path}')
shutil.copyfile(diagram_path, scenario_diagram_path)
scenario[f"{diagramType}DiagramExtension"] = extension
return self.update_scenario(scenario)
except Exception as e:
_log.info(f'unable to find diagram_path: {e}')
return scenario



def copy_scenario(self, id, new_scenario_name):
Expand Down Expand Up @@ -523,6 +547,7 @@ def update_excel(self, id, table_key, updatedTable):
# for column in scenario["data_input"]["df_parameters"][table_key]:

# update excel sheet
_log.info(f'updating table: {updatedTable}')
for column in updatedTable:
y = 3
for cellValue in updatedTable[column]:
Expand All @@ -531,15 +556,16 @@ def update_excel(self, id, table_key, updatedTable):
if cellValue == "":
newValue = None
else:
try:
newValue = int(cellValue)
except ValueError:
try:
newValue = float(cellValue)
except:
newValue = cellValue
newValue = cellValue
# try:
# newValue = int(cellValue)
# except ValueError:
# try:
# newValue = float(cellValue)
# except:
# newValue = cellValue
if originalValue != newValue:
print('updating value')
# print('updating value')
ws[cellLocation] = newValue
y+=1
x+=1
Expand Down
11 changes: 6 additions & 5 deletions electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pareto-ui",
"version": "09.19.23",
"version": "23.10.06",
"author": "Michael Pesce",
"private": true,
"main": "build/main.js",
Expand Down Expand Up @@ -74,10 +74,10 @@
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true,
"artifactName": "ParetoUI-09.19.23-win64.exe"
"artifactName": "ParetoUI-23.10.06-win64.exe"
},
"dmg": {
"artifactName": "ParetoUI-09.19.23-arm64.dmg"
"artifactName": "ParetoUI-23.10.06-arm64.dmg"
},
"deb": {
"depends": [
Expand All @@ -86,7 +86,7 @@
"liblapack3",
"libblas3"
],
"artifactName": "ParetoUI-09.19.23-amd64.deb"
"artifactName": "ParetoUI-23.10.06-amd64.deb"
},
"directories": {
"buildResources": "assets"
Expand All @@ -105,7 +105,8 @@
},
"win": {
"target": "nsis",
"icon": "build/pareto-logo.ico"
"icon": "build/pareto-logo.ico",
"artifactName": "ParetoUI-23.10.06-win64.exe"
},
"linux": {
"target": "Deb",
Expand Down
6 changes: 6 additions & 0 deletions electron/ui/src/assets/CategoryNames.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"v_S_DisposalCapacity_dict":"Slack Disposal Capacity",
"v_S_TreatmentCapacity_dict":"Slack reatment Capacity",
"v_S_ReuseCapacity_dict":"Slack Reuse Capacity",
"v_S_BeneficialReuseCapacity_dict": "Slack Beneficial Reuse Capacity",
"hydraulics.v_PumpHead_dict": "Hydraulics Pump Head",
"hydraulics.vb_Y_Pump_dict": "Hydraulics New Pump",
"hydraulics.v_ValveHead_dict": "Hydraulics Valve Head",
Expand All @@ -106,10 +107,15 @@
"hydraulics.v_Z_HydrualicsCost": "Hydraulics Cost",
"v_Z": "Objective",
"v_R_TotalStorage": "Credit Total Storage",
"v_R_BeneficialReuse_dict": "Credit Beneficial Reuse",
"vb_y_BeneficialReuse_dict": "Beneficial Reuse Usage",
"reuse_WaterKPI": "Produced Water Recycle Rate",
"disposal_WaterKPI": "Produced Water Disposal Rate",
"fresh_CompletionsDemandKPI": "Completions Demand Freshwater Rate",
"reuse_CompletionsDemandKPI": "Recycle Rate",
"ReuseCapacity": "Reuse Capacity",
"ReuseMinimum": "Reuse Minimum",
"BeneficialReuseCredit": "Beneficial Reuse Credit",

"Solver_Stats_dict": "Solver Stats"
}
6 changes: 4 additions & 2 deletions electron/ui/src/assets/Subcategories.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"InitialStorageCapacity","StorageCapacityIncrements","TreatmentCapacityIncrements","TreatmentEfficiency",
"DisposalExpansionCost","StorageExpansionCost","TreatmentExpansionCost","PipelineCapexDistanceBased",
"PipelineCapexCapacityBased","PipelineCapacityIncrements","PipelineExpansionDistance","WellPressure", "Hydraulics","Elevation",
"Economics","PadWaterQuality","StorageInitialWaterQuality","PadStorageInitialWaterQuality","DisposalOperatingCapacity", "RemovalEfficiency"
"Economics","PadWaterQuality","StorageInitialWaterQuality","PadStorageInitialWaterQuality","DisposalOperatingCapacity", "RemovalEfficiency",
"ReuseCapacity", "ReuseMinimum", "BeneficialReuseCredit"
],
"Static": [
"PNA","CNA","CCA","NNA","NCA","NKA","NRA","NSA","FCA","RCA","RNA","RSA","SCA","SNA","PCT","PKT","FCT","CST","CCT","CKT"
"PNA","CNA","CCA","NNA","NCA","NKA","NRA","NSA","FCA","RCA","RNA","RSA","SCA","SNA",
"PCT","PKT","FCT","CST","CCT","CKT","NOA","SOA","ROA","RST","ROT","SOT"
]
}
21 changes: 7 additions & 14 deletions electron/ui/src/components/CustomChart/CustomChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export default function AreaChart(props) {
return 1
})
let tempAreaChartData = []
// Object.entries(tempData).map(([key, value] ) => {
// tempAreaChartData.push({x: value.x, y: value.y, stackgroup: 'one', name: key})
// })

let keys = Object.keys(tempData).sort().reverse()
keys.map((key, ind) => {
let value = tempData[key]
Expand All @@ -46,35 +44,31 @@ export default function AreaChart(props) {
} else {
let tempData = {}
// organize area chart data
// console.log('setting chart data for '+props.title+': ')
// console.log(props.data)
for (var index = 1; index < props.data.length; index++) {
let item = props.data[index]
let key = item[props.labelIndex]
// if(key.length > 4) {
// key=key.substring(0,4)
// console.log(key)
// }
key = key.replace('PostTreatmentTreatedWaterNode',"PTTWN").replace("PostTreatmentResidualNode","PTRN").replace('intermediate','I')
let x = item[props.xindex]
x = parseInt(x.substring(1))
let y = item[props.yindex]
if (key in tempData){
tempData[key].x.push(parseInt(x.substring(1)))
tempData[key].x.push(x)
tempData[key].y.push(y)
}else {
tempData[key] = {x: [x], y: [y]}
}
}
let tempAreaChartData = []
// Object.entries(tempData).map(([key, value] ) => {
// tempAreaChartData.push({x: value.x, y: value.y, stackgroup: 'one', name: key})
// })

// let keys = Object.keys(tempData).sort().reverse()
let keys = Object.keys(tempData).sort()
keys.map((key, ind) => {
let value = tempData[key]
tempAreaChartData.push({x: value.x, y: value.y, stackgroup: props.stackgroup, name: key})
tempAreaChartData.push({x: value.x, y: value.y, stackgroup: props.stackgroup, name: key, mode: "lines"})
return 1
})
// console.log(tempAreaChartData)
setAreaChartData(tempAreaChartData)
}

Expand All @@ -85,7 +79,6 @@ export default function AreaChart(props) {
/*
x values are T values
y values are bbl/week
where does K value go? needs to be a label of some sort
*/
data={areaChartData}
layout={{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from 'react';
import {useState} from 'react';
import Grid from '@mui/material/Grid';
import Accordion from '@mui/material/Accordion';
import AccordionSummary from '@mui/material/AccordionSummary';
import AccordionDetails from '@mui/material/AccordionDetails';
import ListItemText from '@mui/material/ListItemText';
import Checkbox from '@mui/material/Checkbox';
import ListItemIcon from '@mui/material/ListItemIcon';
import Button from '@mui/material/Button';
import MenuItem from '@mui/material/MenuItem';
import Typography from '@mui/material/Typography';


export default function FilterDropdown(props) {
const styles = {
iconSelected: {
backgroundColor:'#6094bc',
color: 'white',
borderRadius: 10,
},
iconUnselected: {
borderRadius: 10,
color:'black',
}
}


return (
<Accordion style={{minWidth:props.width }} sx={{minWidth:props.width, zIndex: 2}}>
<AccordionSummary sx={{marginBottom: 0, paddingBottom:0}} style={{justifyContent:"center"}}>
<Typography noWrap align="center" sx={{width: '100%',fontWeight: "bold", color: "#0884b4"}}>Node Filters</Typography>
</AccordionSummary>
<AccordionDetails sx={{ maxHeight:props.maxHeight, overflow: "scroll", marginTop:0, paddingTop:0}}>
<MenuItem value="all" onClick={()=> props.handleFilter("all")}>
<ListItemIcon>
<Checkbox
checked={props.isAllSelected}
indeterminate={
props.filtered.length > 0 && props.filtered.length < props.total.length
}
/>
</ListItemIcon>
<ListItemText
primary="Select All"
/>
</MenuItem>
{
Object.entries(props.filtered).map(([key,value]) => (
<MenuItem key={key} value={key} onClick={()=> props.handleFilter(key)}>
<ListItemIcon>
<Checkbox checked={value} />
</ListItemIcon>
<ListItemText primary={key} />
</MenuItem>
))}



</AccordionDetails>
</Accordion>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default function NetworkDiagram(props) {
<IconButton onClick={() => handleDelete()}><CloseIcon/></IconButton>
</Grid>
<Grid item xs ={11.5}>
<img alt="network diagram" style={{height:"500px"}} src={`file://${diagramImage}`}></img>
<img alt="network diagram" style={{width: "100%"}} src={`file://${diagramImage}`}></img>
</Grid>
</Grid>

Expand Down
8 changes: 4 additions & 4 deletions electron/ui/src/views/LandingPage/LandingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ export default function LandingPage(props) {
</Grid>
<Grid item xs={2}> </Grid>

<Grid item xs={5}> </Grid>
<Grid item xs={2}>
<Grid item xs={3}> </Grid>
<Grid item xs={6}>
<Box>
<p style={{paddingTop:0, marginTop: 0, color:"#9c9c9c"}}>v 1.0.0</p>
<p style={{paddingTop:0, marginTop: 0, color:"#9c9c9c"}}>v23.10.06 (PARETO v0.9.0)</p>
</Box>
</Grid>
<Grid item xs={5}> </Grid>
<Grid item xs={3}> </Grid>

<Grid item xs={1}> </Grid>
<Grid item xs={10}>
Expand Down
Loading
Loading