This project is a simple function plotter application built using PySide2 for the GUI and Matplotlib for plotting. The application allows users to input a mathematical function and plot its graph over a specified range.
- Input a function of
x
, e.g.,5*x^3 + 2*x
. - Specify minimum and maximum values for
x
. - Supports operators:
+
,-
,/
,*
,^
,log10()
,sqrt()
. - Input validation with user-friendly error messages.
- GUI built using PySide2.
- Plotting powered by Matplotlib.
This project is developed and tested using Python 3.9. Due to compatibility issues with PySide2 in newer Python versions, it is highly recommended to use Python 3.9 for running this application.
Download Python 3.9.6 from the official Python website: Python 3.9.6
The version used in this project is python3.9.6 that is mentioned above.
-
Clone the repository:
git clone https://github.com/HalemoGPA/master_micro_task.git cd master_micro_task
-
Create a virtual environment:
python -m venv master_micro master_micro\Scripts\activate # On macOS and Linux, use `source master_micro/bin/activate`
-
Install the required dependencies:
pip install -r requirements.txt
To run the application, execute the following command:
python src/main.py
To run the tests, use the following command:
pytest
- Function:
5*x^3 + 2*x + !
- Range:
0
to10
- Expected Output: Error message: "Function contains invalid characters."
- Function:
5*x^3 + 2*x -4/x + 7
- Range:
-10
to10
- Expected Output: Combined plot of Cubic and rational functions.
- Function:
2*x^4 - log10(x) + sqrt(x)
- Range:
0
to50
- Expected Output: Combined plot of square root, logarithm, and quadratic function.