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

adding demo files to build_and_test.sh run #55

Merged
merged 24 commits into from
Dec 12, 2023
Merged

adding demo files to build_and_test.sh run #55

merged 24 commits into from
Dec 12, 2023

Conversation

robinsteuteville
Copy link
Collaborator

@robinsteuteville robinsteuteville commented Oct 4, 2023

I added a run_all.py file and added that to the build_and_test.sh file. As long as I x out of the graphs/tables that are made as the sh file runs the demo files, the sh file seems to properly run the files (if I don't x out of the graph/table, it will stop running until I do so). One of the files is throwing errors when I try to run them (see below), so I will now move on to troubleshooting those.

@robinsteuteville
Copy link
Collaborator Author

fusion_thermal_demo.py was not able to run due to the following error:
image

@robinsteuteville
Copy link
Collaborator Author

robinsteuteville commented Oct 4, 2023

The following files run with warnings:
accel_demo.py
cav_demo.py
demo_abc_drag_coef_conv.py
demo.py
mp_parallel_demo.py
time_dilation_demo.py
The following files ran without any warnings or errors:
demo_eu_vehicle_wltp.py
stop_start_demo.py
timing_demo.py

@robinsteuteville
Copy link
Collaborator Author

@calbaker I think I successfully created a file run_all.py which finds all files in the demos folder which have 'demo' in the title and end in .py and runs them. I added this file to the build_and_test.sh so that it runs whenever the build_and_test.sh file is run. A couple things: right now, each of the demo files runs fully, which leads to many lines of output, making it hard to tell which files have run and, if the overall build_and_test.sh doesn't run, which file caused the error. Would it be better to figure out a way to run each file which only returned whether or not the file successfully ran, rather than all the demo file's outputs? Not sure how to do this off the top of my head but happy to work on this if you think it would be helpful. Also, is there anything I should do in order to make it so that the demo folder doesn't get downloaded with the program when fastsim is installed with pip, and instead is downloaded separately like in altrios?

@robinsteuteville
Copy link
Collaborator Author

robinsteuteville commented Oct 31, 2023

The latest commit implements altrios-style demos testing in the build_and_test.sh file. The sh file now runs all of the demos files, without showing the plots (a SHOW_PLOTS variable is used to determine whether or not the plots are shown, with the variable being false for the sh tests). Also partially implemented is a function in the utilities file that downloads the demos files (so that users can download and modify demos files). @calbaker how do I add the demos check to the github tests? Not sure how to get started with that. Also, there are two files in the tests folder -- test_cav_demo.py and test_demo.py that I believe are now redundant and can be deleted. It seems to me like these to files exist to test the cav_demo.py and demo.py files, which are now being tested along with the other files. Does this seem correct?

@robinsteuteville
Copy link
Collaborator Author

Most recent commit adding "requests" python library to pyproject.toml made it so all the github checks passed (before, none of them did).

@calbaker calbaker marked this pull request as draft November 3, 2023 15:19
@calbaker calbaker changed the title [DRAFT] adding demo files to build_and_test.sh run adding demo files to build_and_test.sh run Nov 3, 2023
@calbaker
Copy link
Collaborator

@robinsteuteville , I think you could actually probably figure this one out based on spending ~20 minutes doing initial troubleshooting

@robinsteuteville robinsteuteville marked this pull request as ready for review November 30, 2023 21:05
@calbaker
Copy link
Collaborator

calbaker commented Dec 4, 2023

@robinsteuteville , is this one ready to go?

@robinsteuteville
Copy link
Collaborator Author

@robinsteuteville , is this one ready to go?

@calbaker I believe so. I fixed the issues that you noted earlier -- perhaps check to make sure they seem good to you, and if so, it should be ready to merge.

Steuteville and others added 2 commits December 4, 2023 16:40
…demos

# Conflicts:
#	python/fastsim/demos/cav_demo.py
#	python/fastsim/tests/test_cav_demo.py
#	python/fastsim/tests/test_demo.py
@calbaker calbaker merged commit ecbf517 into fastsim-2 Dec 12, 2023
3 checks passed
@calbaker calbaker deleted the fix-demos branch December 12, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants