Name | PyCFF JSON |
Version |
1.1.10
JSON |
| download |
home_page | None |
Summary | A function fitting tool |
upload_time | 2025-08-26 07:52:39 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
pyside6
application
widget
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Languages
- en [English](README.md)
- zh_CN [简体中文](README.zh_CN.md)
# PyCFF
a Python-based curve fitting tool
---
A simple program written in Python, which implements function fitting through numpy and scipy, and uses PySide to write the user interface. It implements the function of fitting function parameters from input data to output, and supports data prediction and custom function functions.
## 1. Introduction
Repository:[PyCFF](https://github.com/AndrewMoa2005/PyCFF/)
### 1.1 User Interface
Below is the software's startup interface. The software interface is implemented using PySide (Qt). It supports function drawing, allowing users to customize drawing content and save output images.

The image below shows the software's input interface. Input data is presented in a table format, and users select the independent variable (x) and dependent variable (y) to be fitted by specifying columns. Users can enter data manually in the table, paste data from spreadsheet software like Excel, and quickly enter large amounts of data using the **Paste Replace Columns** feature.

The image below shows the software's output interface. The software pre-defines some common functions. Clicking an operation displays the function parameters in the table on the left and the complete function expression in the text box. Users can customize the precision of the output parameters and whether to use scientific notation. The default setting is scientific notation with six decimal places, which meets the needs of most engineering calculations.

### 1.2 Custom Functions
The software includes predefined functions such as polynomials, exponentials, logarithms, and power functions. In addition to these predefined functions, the software also supports user-defined functions. Custom functions such as `a+b*x**1+c*x**2` and `-omega-alpha * exp(x)` automatically extract their parameters and fit them to the input data. Custom functions support not only the four arithmetic operations (+, -, *, /) and power operations (** or ^), but also common functions. See the table below for specific functions and their descriptions.

| Function | Usage | Description |
|---|---|---|
| exp | exp(a) | Calculates the exponential value of a |
| pow | pow(a, b) | Calculates a raised to the power of b |
| abs | abs(a) | Calculates the absolute value of a |
| sqrt | sqrt(a) | Calculates the square root of a |
| cbrt | cbrt(a) | Calculates the cube root of a |
| log | log(a) | Calculates the base e logarithm of a |
| log10 | log10(a) | Calculates the base 10 logarithm of a |
| log2 | log2(a) | Calculates the base 2 logarithm of a |
| min | min(a) | Calculates the minimum value of a |
| max | max(a) | Calculates the maximum value of a |
| sin | sin(a) | Calculates the sine of a |
| cos | cos(a) | Find the cosine of a |
| tan | tan(a) | Find the tangent of a |
| asin | asin(a) | Find the inverse sine of a |
| acos | acos(a) | Find the inverse cosine of a |
| atan | atan(a) | Find the inverse tangent of a |
| sinh | sinh(a) | Find the hyperbolic sine of a |
| cosh | cosh(a) | Find the hyperbolic cosine of a |
| tanh | tanh(a) | Find the hyperbolic tangent of a |
| asinh | asinh(a) | Find the inverse hyperbolic sine of a |
| acosh | acosh(a) | Find the inverse hyperbolic cosine of a |
| atanh | atanh(a) | Find the inverse hyperbolic tangent of a |
| pi | pi() | Pi |
| e | e() | base of natural logarithms |
## 2. Build
### 2.1 Build Environment
The source code provides a `build.py` script for quick and easy building. Users should create a virtual environment before building:
```bash
python -m venv myvenv # myvenv is the name of the virtual environment, which can be defined as needed
```
On Windows, use the following command to activate the virtual environment:
```powershell
./myvenv/Scripts/activate # in windows, it is recommended to run under posershell
```
On Linux, use the following command to activate the virtual environment:
```bash
source ./myvenv/bin/activate # in posix
```
After activating the virtual environment, the `(myvenv)` character will be displayed at the beginning of the command line, indicating that Python under the command line is running in the virtual environment `myvenv`. Install the dependencies using the following command:
```bash
pip install -r requirements.txt
```
After the build is complete, exit the virtual environment by deactivating it:
```bash
deactivate # The same command is used under windows and posix
```
### 2.2 Build Script
Run the following command to display help information for the build script:
```
python build.py -h
```

- The `-h`/`--help` switch displays command-line help.
- The `-c`/`--copy` switch copies the source code to a specified directory for debugging purposes.
- The `-b`/`--build` switch runs `pyinstaller` to package the source code into an executable file. `dir` packages the source code into a directory (the default), and `one` packages the source code into a single executable file.
- The `-u`/`--update` switch compiles `.ui` and `.qrc` files in the source code into `.py` files for debugging purposes.
- The `-t`/`--translate` switch allows for multi-language translation. `up` updates `.ts` files in the source code, `gui` launches the `linguistgui` interface and opens `.ts` files, and `gen` compiles `.ts` files into `.qm` files. This switch is typically used for debugging purposes only.
- The `-p`/`--pyd` switch compiles the `.py` file into `.pyd`/`.so`, then runs `pyinstaller` to package it into an executable file. `dir` packages the file into a directory (the default), and `one` packages the file into a single executable file.
- The `-g`/`--genwhl` switch generates a whl distribution package.
In general, you can quickly build an executable program using the following command:
```bash
python build.py -p
```
The generated executable file/folder is located in the `[source_dir]/build/pycff/dist` directory.
You can quickly build the whl distribution package using the following command:
```bash
python build.py -g
```
The generated whl file is in the `[source_dir]/build/dist` path. You can install the release package through `pip install pycff-{version}-py3-none-{platform}.whl`. After the release package is installed, you can start the main program through `pycff` or `python -m pycff`.
## 3. Quick Start
### 3.1 Input
Perform data input operations in the `Input` tag.
- The program initially displays a 2×5 table. You can resize the table using the top input bar and the "Insert" and "Delete" options on the right-click menu.
- You can copy and paste Excel spreadsheets to access data, or load and save data by reading and writing files (currently only CSV files are supported).
- You can define row and column headers to distinguish data.
- You can use the "Paste Replace Column" option on the right-click menu to quickly load data from the clipboard into a specified column. The data is automatically split by non-numeric characters, making it easy to quickly read large amounts of data.
- After entering data, select the columns corresponding to the independent variable (x) and dependent variable (y) using the checkboxes on the right, then click the "Refresh" button to load the table data.

### 3.2 Plot
Perform simple plotting operations in the Plot tab.
- The initial plot displays the scatter plot data (red solid lines) and the fitted curve (black smooth dashed line) from the previous 5×2 table.
- Click the Refresh button in this tab to draw the scatter plot using the input data.
- You can customize the plot title, axis labels, and number format, as well as curve labels, colors, line types, and thickness.
- You can save plots, currently supporting SVG and PNG formats.

### 3.3 Output
Perform function fitting in the "Output" tab.
- Select the function type from the checkbox at the top left: a predefined function or a custom function.
- Click the "Calculate" button at the top right. The calculated function parameters and R<sup>2</sup> value will be displayed in the table on the left, and the complete function expression will be displayed in the text box on the right.
- You can customize the numeric format of the displayed parameters using the checkbox at the top right.
- After calculating the function parameters, click the "Refresh" button to plot a scatter plot and function curve in the "Plot" tab. You can customize the level of detail of the function curve.
- In the two sets of input boxes at the bottom, you can calculate the Y value of the function by entering an X value, or predict the X value given a Y value for data prediction.


## 4. Plan
Currently, the program implements basic functions such as table input and output, plotting, and function fitting. Future plans include the following features:
- Formula calculation in tables
- Reading and writing Excel files
- Copying plotted data to the clipboard
- Other user concerns...
For further comments and suggestions, please submit [Issues](https://github.com/AndrewMoa2005/PyCFF/issues).
Raw data
{
"_id": null,
"home_page": null,
"name": "PyCFF",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "PySide6, application, widget",
"author": null,
"author_email": "Andrew Moa <Andrew.Moa2005@163.com>",
"download_url": null,
"platform": null,
"description": "# Languages\n\n- en [English](README.md)\n- zh_CN [\u7b80\u4f53\u4e2d\u6587](README.zh_CN.md)\n\n# PyCFF\na Python-based curve fitting tool\n\n---\n\nA simple program written in Python, which implements function fitting through numpy and scipy, and uses PySide to write the user interface. It implements the function of fitting function parameters from input data to output, and supports data prediction and custom function functions.\n\n## 1. Introduction\n\nRepository\uff1a[PyCFF](https://github.com/AndrewMoa2005/PyCFF/)\n\n### 1.1 User Interface\n\nBelow is the software's startup interface. The software interface is implemented using PySide (Qt). It supports function drawing, allowing users to customize drawing content and save output images.\n\n\nThe image below shows the software's input interface. Input data is presented in a table format, and users select the independent variable (x) and dependent variable (y) to be fitted by specifying columns. Users can enter data manually in the table, paste data from spreadsheet software like Excel, and quickly enter large amounts of data using the **Paste Replace Columns** feature.\n\n\nThe image below shows the software's output interface. The software pre-defines some common functions. Clicking an operation displays the function parameters in the table on the left and the complete function expression in the text box. Users can customize the precision of the output parameters and whether to use scientific notation. The default setting is scientific notation with six decimal places, which meets the needs of most engineering calculations.\n\n\n### 1.2 Custom Functions\n\nThe software includes predefined functions such as polynomials, exponentials, logarithms, and power functions. In addition to these predefined functions, the software also supports user-defined functions. Custom functions such as `a+b*x**1+c*x**2` and `-omega-alpha * exp(x)` automatically extract their parameters and fit them to the input data. Custom functions support not only the four arithmetic operations (+, -, *, /) and power operations (** or ^), but also common functions. See the table below for specific functions and their descriptions.\n\n\n\n| Function | Usage | Description |\n|---|---|---|\n| exp | exp(a) | Calculates the exponential value of a |\n| pow | pow(a, b) | Calculates a raised to the power of b |\n| abs | abs(a) | Calculates the absolute value of a |\n| sqrt | sqrt(a) | Calculates the square root of a |\n| cbrt | cbrt(a) | Calculates the cube root of a |\n| log | log(a) | Calculates the base e logarithm of a |\n| log10 | log10(a) | Calculates the base 10 logarithm of a |\n| log2 | log2(a) | Calculates the base 2 logarithm of a |\n| min | min(a) | Calculates the minimum value of a |\n| max | max(a) | Calculates the maximum value of a |\n| sin | sin(a) | Calculates the sine of a |\n| cos | cos(a) | Find the cosine of a |\n| tan | tan(a) | Find the tangent of a |\n| asin | asin(a) | Find the inverse sine of a |\n| acos | acos(a) | Find the inverse cosine of a |\n| atan | atan(a) | Find the inverse tangent of a |\n| sinh | sinh(a) | Find the hyperbolic sine of a |\n| cosh | cosh(a) | Find the hyperbolic cosine of a |\n| tanh | tanh(a) | Find the hyperbolic tangent of a |\n| asinh | asinh(a) | Find the inverse hyperbolic sine of a |\n| acosh | acosh(a) | Find the inverse hyperbolic cosine of a |\n| atanh | atanh(a) | Find the inverse hyperbolic tangent of a |\n| pi | pi() | Pi |\n| e | e() | base of natural logarithms |\n\n## 2. Build\n\n### 2.1 Build Environment\n\nThe source code provides a `build.py` script for quick and easy building. Users should create a virtual environment before building:\n```bash\npython -m venv myvenv # myvenv is the name of the virtual environment, which can be defined as needed\n```\n\nOn Windows, use the following command to activate the virtual environment:\n```powershell\n./myvenv/Scripts/activate # in windows, it is recommended to run under posershell\n```\n\nOn Linux, use the following command to activate the virtual environment:\n```bash\nsource ./myvenv/bin/activate # in posix\n```\n\nAfter activating the virtual environment, the `(myvenv)` character will be displayed at the beginning of the command line, indicating that Python under the command line is running in the virtual environment `myvenv`. Install the dependencies using the following command:\n```bash\npip install -r requirements.txt\n```\n\nAfter the build is complete, exit the virtual environment by deactivating it:\n```bash\ndeactivate # The same command is used under windows and posix\n```\n\n### 2.2 Build Script\n\nRun the following command to display help information for the build script:\n```\npython build.py -h\n```\n\n\n - The `-h`/`--help` switch displays command-line help.\n - The `-c`/`--copy` switch copies the source code to a specified directory for debugging purposes.\n - The `-b`/`--build` switch runs `pyinstaller` to package the source code into an executable file. `dir` packages the source code into a directory (the default), and `one` packages the source code into a single executable file.\n - The `-u`/`--update` switch compiles `.ui` and `.qrc` files in the source code into `.py` files for debugging purposes.\n - The `-t`/`--translate` switch allows for multi-language translation. `up` updates `.ts` files in the source code, `gui` launches the `linguistgui` interface and opens `.ts` files, and `gen` compiles `.ts` files into `.qm` files. This switch is typically used for debugging purposes only.\n - The `-p`/`--pyd` switch compiles the `.py` file into `.pyd`/`.so`, then runs `pyinstaller` to package it into an executable file. `dir` packages the file into a directory (the default), and `one` packages the file into a single executable file.\n - The `-g`/`--genwhl` switch generates a whl distribution package.\n\nIn general, you can quickly build an executable program using the following command:\n```bash\npython build.py -p\n```\nThe generated executable file/folder is located in the `[source_dir]/build/pycff/dist` directory.\n\nYou can quickly build the whl distribution package using the following command:\n```bash\npython build.py -g\n```\nThe generated whl file is in the `[source_dir]/build/dist` path. You can install the release package through `pip install pycff-{version}-py3-none-{platform}.whl`. After the release package is installed, you can start the main program through `pycff` or `python -m pycff`.\n\n## 3. Quick Start\n\n### 3.1 Input\n\nPerform data input operations in the `Input` tag.\n\n - The program initially displays a 2\u00d75 table. You can resize the table using the top input bar and the \"Insert\" and \"Delete\" options on the right-click menu.\n - You can copy and paste Excel spreadsheets to access data, or load and save data by reading and writing files (currently only CSV files are supported).\n - You can define row and column headers to distinguish data.\n - You can use the \"Paste Replace Column\" option on the right-click menu to quickly load data from the clipboard into a specified column. The data is automatically split by non-numeric characters, making it easy to quickly read large amounts of data.\n - After entering data, select the columns corresponding to the independent variable (x) and dependent variable (y) using the checkboxes on the right, then click the \"Refresh\" button to load the table data.\n\n\n### 3.2 Plot\n\nPerform simple plotting operations in the Plot tab.\n\n - The initial plot displays the scatter plot data (red solid lines) and the fitted curve (black smooth dashed line) from the previous 5\u00d72 table.\n - Click the Refresh button in this tab to draw the scatter plot using the input data.\n - You can customize the plot title, axis labels, and number format, as well as curve labels, colors, line types, and thickness.\n - You can save plots, currently supporting SVG and PNG formats.\n\n\n### 3.3 Output\n\nPerform function fitting in the \"Output\" tab.\n\n - Select the function type from the checkbox at the top left: a predefined function or a custom function.\n - Click the \"Calculate\" button at the top right. The calculated function parameters and R<sup>2</sup> value will be displayed in the table on the left, and the complete function expression will be displayed in the text box on the right.\n - You can customize the numeric format of the displayed parameters using the checkbox at the top right.\n - After calculating the function parameters, click the \"Refresh\" button to plot a scatter plot and function curve in the \"Plot\" tab. You can customize the level of detail of the function curve.\n - In the two sets of input boxes at the bottom, you can calculate the Y value of the function by entering an X value, or predict the X value given a Y value for data prediction.\n\n\n\n## 4. Plan\n\nCurrently, the program implements basic functions such as table input and output, plotting, and function fitting. Future plans include the following features:\n\n - Formula calculation in tables\n - Reading and writing Excel files\n - Copying plotted data to the clipboard\n - Other user concerns...\n\nFor further comments and suggestions, please submit [Issues](https://github.com/AndrewMoa2005/PyCFF/issues).\n",
"bugtrack_url": null,
"license": null,
"summary": "A function fitting tool",
"version": "1.1.10",
"project_urls": {
"Homepage": "https://github.com/AndrewMoa2005/PyCFF",
"Repository": "https://github.com/AndrewMoa2005/PyCFF.git"
},
"split_keywords": [
"pyside6",
" application",
" widget"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "60ded19bf3265c69399dbc54160a1948ea1bd91407391ef141b55a49d373e3d3",
"md5": "ba5330731069d9465052e01c7021ba93",
"sha256": "a806fd7d09eed64aba164c08b8f2d71d37dfeedce1815ef07f818521348d8411"
},
"downloads": -1,
"filename": "pycff-1.1.10-py3-none-macosx_10_14_x86_64.whl",
"has_sig": false,
"md5_digest": "ba5330731069d9465052e01c7021ba93",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 1244298,
"upload_time": "2025-08-26T07:52:39",
"upload_time_iso_8601": "2025-08-26T07:52:39.068042Z",
"url": "https://files.pythonhosted.org/packages/60/de/d19bf3265c69399dbc54160a1948ea1bd91407391ef141b55a49d373e3d3/pycff-1.1.10-py3-none-macosx_10_14_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "30335263c45a26ae78b2b6640ce7c3382144b78a071798f8947708811bdb108f",
"md5": "14ad6a1af6b600f2edf65065b1df131f",
"sha256": "98302d38147aa90840144e330efe9a6fe6f4eaecbff7b8914b838cb3f9a6be82"
},
"downloads": -1,
"filename": "pycff-1.1.10-py3-none-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "14ad6a1af6b600f2edf65065b1df131f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4835559,
"upload_time": "2025-08-26T07:51:41",
"upload_time_iso_8601": "2025-08-26T07:51:41.015804Z",
"url": "https://files.pythonhosted.org/packages/30/33/5263c45a26ae78b2b6640ce7c3382144b78a071798f8947708811bdb108f/pycff-1.1.10-py3-none-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "033e339475186134a3716feb1ce5eeab1e7770c9bb2bde9219ecfd5297767a9d",
"md5": "4db1020f4fdd0a1a2729a5502eb2410a",
"sha256": "e176a77b407b8d1860c61a83406c530a93be779f1a0ab6b52ece8227c02a6962"
},
"downloads": -1,
"filename": "pycff-1.1.10-py3-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "4db1020f4fdd0a1a2729a5502eb2410a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 567767,
"upload_time": "2025-08-26T07:52:21",
"upload_time_iso_8601": "2025-08-26T07:52:21.440022Z",
"url": "https://files.pythonhosted.org/packages/03/3e/339475186134a3716feb1ce5eeab1e7770c9bb2bde9219ecfd5297767a9d/pycff-1.1.10-py3-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-26 07:52:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AndrewMoa2005",
"github_project": "PyCFF",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pycff"
}