Skip to content

Electromagnetic-Wave-Scattering-Group/EMWS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

142 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Electromagnetic Wave Scattering

Developers: Noah Templet; Michael Sheppard III; James Carter; Joel Keller
Research Supervisor: Stephen Shipman

Developer Setup

Install Git https://git-scm.com/downloads

Install Visual Studio Code https://code.visualstudio.com/download

Get the code next. In Visual Studio Code, you should see the Explorer view in the left-hand window, if not press ctrl+shift+P to open it. There you should see and click the option Clone Repository. Next, type in the repository URL for the EMWS code when prompted. For my example, I used my own fork of the code at https://github.com/awelters/EMWS-2020.git. Finally, select (or create) the local directory into which you want to clone the project and when prompted make sure to click Add to Workspace.

By default the EMWS repo's branch of code when cloned is master. If for example you wanted to work on the improve-developer-experience branch you need to check it out. To do so, open the integrated terminal in Visual Studio code by pressing ctrl+shift+` and then run the following command:

git checkout improve-developer-experience

Install the Python plugin extension to help with IntelliSense. You can do so by pressing ctrl+shift+X to open the Extensions view in the left-hand window, clicking the Python extension, and finally clicking the Install button.

Download miniconda, ensure path set correctly, in windows easiest to use the installer https://docs.conda.io/projects/miniconda/en/latest/

Update to the latest version with the following command:

conda update -n base -c defaults conda

Create your environment from the environment file with the following command:

conda env create --file environment.yaml

Activate your environment to starting using it with the following command:

conda activate emws

In Visual Studio Code, press ctrl+shift+P to open the command palette. Next, type Python: Select Interpreter in the search box. Now, scroll down to where you see the current project and click it, in my case it's EMWS-2020. Finally, select the Python version that includes the emws keyword. By default your now developing in the right emws environment.

If you are not using Conda/Visual Studio Code then take a look at the environment.yaml file to see the required version of python and libraries installed. Your mileage may differ ;)

Starting the App

Starting the Frontend

In Visual Studio Code, press ctrl+shift+D to open the debugger. Next, in the upper left from the 'RUN AND DEBUG' options select Python: Frontend (EMWS-2020). Finally, click the play button to run it locally. This creates a HTTP server in the frontend directory. You can now open your browser to http://localhost:8000/ to use it. Note: you will also need to start the backend api in order to have the app completely working.

If you are not using Conda/Visual Studio Code and are just running it from the command line with Python already installed using the following commands:

cd frontend
python -m http.server

Starting the Backend Api

In Visual Studio Code, press ctrl+shift+D to open the debugger. Next, in the upper left from the 'RUN AND DEBUG' options select Python: Backend API (EMWS-2020). Finally, click the play button to run it locally. You can now open your browser to http://localhost:5000/ to see it is working. Note: you will also need to start the frontend in order to have the app completely working.

If you are not using Conda/Visual Studio Code and are just running it from the command line with Python already installed using the following commands:

cd backend/api
python app.py

Debugging the App

Debugging the Frontend

Your best friend when debugging the frontend is to simply open the frontend in the Chrome browser and then press F12. This will open the Inspector and Debugger tool. From here you can see console output, network traffic, etc. You can also put breakpoints in the source. Details on usage is beyond the scope of this document.

Debugging the Backend Api

If you are using Visual Studio Code you can simply place a breakpoint anywhere in the backend api python code and when the api runs and hits that line it will break so you can inspect the code. Details on further usage is beyond the scope of this document.

Debugging a Backend script

If you are using Visual Studio Code, first make sure you open a python script. Put breakpoints where you'd like. Next, press ctrl+shift+D to open the debugger and then in the upper left from the 'RUN AND DEBUG' options select Python: Debug File (EMWS-2020). Finally, click the play button to run the python script to debug it. When the script runs and hits those lines it will break so you can inspect the code. Details on further usage is beyond the scope of this document.

Deployment

Backend Deployment Instructions

Helpful Conda commands

Save environment for others to use (shallow dependencies) - make sure to remove the prefix: ... line conda env export --from-history > environment.yaml

Save environment for others to use (deep dependencies) - make sure to remove the prefix: ... line conda env export > environment.yml

Deactivate environment conda deactivate

Remove environment conda env remove -n emws

About

Interactive GUI for Electromagnetic Wave Scattering problems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 92.6%
  • SCSS 2.8%
  • CSS 2.1%
  • HTML 1.8%
  • Python 0.7%