Skip to content

AI091/Function_Plotter

Repository files navigation

GUI Function Plotter

Description

This project is a mathematical function plotter developed with PySide2 and Matplotlib.

Using this project

First clone the repo using

git clone https://github.com/AI091/Function_Plotter.git

Then go into the directory

cd <local_repo_dir>

Then install the dependencies using

pip install -r requirements.txt

Working examples

Listed below are examples of correct input with their corresponding output

x^2 3*x+1 x^4 +3*x^2 + 1/x

Wrong examples

Demonstrated below is some wrong input with their corresponding error messages


Using Y which is not a supported operand

wrong_example1


Empty Input

wrong_example2


Invalid Mathematical expression

wrong_example3


Min larger than max

wrong_example4


Project Layout

└── Function_Plotter
   ├── app.py
   ├── canvas.py
   ├── config.py
   ├── custom_errors.py
   ├── function_input.py
   ├── helper.py
   ├── test.py
   ├── requirements.txt
   ├── pytest.ini

  • app.py : defines the main window and runs the application .

  • canvas.py : defines the plotting canvas .

  • config.py : defines some plotting parameters like the number of points used for plotting .

  • custom_errors.py : defines custom errors used in the project .

  • function_input.py : defines the widget that takes the input function .

  • helper.py : defines helper functions for parsing the input in a modular fashion .

  • test.py : defines the automated tests for the functionality of the app's separate parts and end to end as a whole .

  • requirements.txt : defines the required dependencies to install the project.

  • pytest.ini : defines the required configuration for pytest to run the tests properly.

Testing

The project has automated tests defined in test.py that are written using pytest and pytest-qt . To run the tests :

pytest test.py

Releases

No releases published

Packages

No packages published

Languages