Skip to content

Commit 9435154

Browse files
authored
Merge pull request #2 from MShirazAhmad/copilot/revise-branding-and-add-plugins
Revise ReadTheDocs homepage branding and add complete plugin-system guides
2 parents aa67730 + 45a96fb commit 9435154

5 files changed

Lines changed: 134 additions & 4 deletions

File tree

docs/extensions/curvefitting.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ If your plotted data looks like a line, choose a linear fit. If your plotted
2323
data follows exponential decay, choose an exponential model. A curve-fitting
2424
plugin is simply a small file that tells PhysPlot what equation to use.
2525

26+
Where Curve Fits Appear in the UI
27+
---------------------------------
28+
29+
Discovered curve-fitting plugins are listed in the curve-fit configuration
30+
window. PhysPlot discovers these files at startup.
31+
2632
Required File Location
2733
----------------------
2834

@@ -87,7 +93,19 @@ Callable Template
8793
Returns:
8894
numpy.ndarray: Model Y values for the input X array.
8995
"""
90-
return amplitude * np.exp(-((x - center) / width) ** 2)
96+
return amplitude * np.exp(-((x - center) / width) ** 2)
97+
98+
Step-by-Step: Build a New Curve-Fit Plugin
99+
------------------------------------------
100+
101+
1. Create a new file in ``curvefitting/`` (for example
102+
``curvefitting/12_gaussian.py``).
103+
2. Add ``DISPLAY_NAME``, ``DEFAULT_LABEL``, ``KIND``, and ``LABEL_MODES``.
104+
3. For ``KIND = "poly"``, add ``DEGREE``.
105+
4. For ``KIND = "callable"``, implement ``function(x, ...)`` and optionally
106+
add ``INITIAL_GUESS``.
107+
5. Restart PhysPlot so the new fit appears in the curve-fit list.
108+
6. Select the fit in the configuration window and apply it to plotted data.
91109

92110
Required Fields
93111
---------------

docs/extensions/fileloading.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ File-loader plugins convert external data files into a two-dimensional table
88
that PhysPlot can display. A loader receives a file path and returns a
99
rectangular data array.
1010

11+
Where Loaders Appear in the UI
12+
------------------------------
13+
14+
Discovered loaders are shown in two places:
15+
16+
- **Settings > File Loader** (menu selection)
17+
- **Data Loader** dropdown above the **Import Data** button (quick selection)
18+
19+
The selected loader is used when importing files. PhysPlot discovers loader
20+
files at startup.
21+
1122
Layman Example
1223
--------------
1324

@@ -81,7 +92,31 @@ Minimal CSV-Like Template
8192
if len(parts) < 2:
8293
continue
8394
rows.append((float(parts[0]), float(parts[1])))
84-
return np.asarray(rows, dtype=float)
95+
return np.asarray(rows, dtype=float)
96+
97+
Step-by-Step: Build a New Loader
98+
--------------------------------
99+
100+
1. Create a new file in ``fileloader/`` (for example
101+
``fileloader/my_device_loader.py``).
102+
2. Define a human-readable ``title`` string.
103+
3. Implement ``load_data(file_path)`` to parse your format and return a 2D
104+
array-like result.
105+
4. Optionally define ``DEFAULT_COLUMN_ROLES`` to pre-assign column roles after
106+
import.
107+
5. Restart PhysPlot so the loader is discovered and added to the menu and
108+
dropdown.
109+
6. Select your loader from **Settings > File Loader** or the **Data Loader**
110+
dropdown, then import a file.
111+
112+
Loader Categories
113+
-----------------
114+
115+
- **General tabular loader**: parse delimited numeric files.
116+
- **Instrument-specific loader**: skip custom headers/metadata and keep
117+
meaningful columns.
118+
- **Role-aware loader**: also sets ``DEFAULT_COLUMN_ROLES`` for automatic
119+
X/Y mapping.
85120

86121
OES HRF Pattern
87122
---------------

docs/extensions/functions.rst

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ PhysPlot reads the input column as a one-dimensional numeric array, calls the
1616
plugin's ``transform(values)`` function, then writes the returned values into
1717
the output column.
1818

19+
Where Functions Appear in the UI
20+
--------------------------------
21+
22+
Discovered function plugins are available in:
23+
24+
- The top-bar **Functions** menu
25+
- The transform dropdown in the data-manipulation controls
26+
27+
PhysPlot discovers function files at startup.
28+
1929
Layman Example
2030
--------------
2131

@@ -82,7 +92,28 @@ Minimal Template
8292
maximum = np.nanmax(values)
8393
if maximum == minimum:
8494
return np.zeros_like(values)
85-
return (values - minimum) / (maximum - minimum)
95+
return (values - minimum) / (maximum - minimum)
96+
97+
Step-by-Step: Build a New Function
98+
----------------------------------
99+
100+
1. Create a new file in ``functions/`` (for example
101+
``functions/15_normalize.py``).
102+
2. Define ``DISPLAY_NAME`` for the GUI entry.
103+
3. Define ``DEFAULT_LABEL`` for generated labels.
104+
4. Implement ``transform(values)`` and return one value per input row.
105+
5. Restart PhysPlot so the function appears in the menu and dropdown.
106+
107+
Function Categories
108+
-------------------
109+
110+
Common categories used by PhysPlot plugins include:
111+
112+
- **Identity/basic**: pass-through operations.
113+
- **Power/reciprocal**: ``x^2``, ``x^3``, ``1/x``.
114+
- **Log/exp**: ``log10``, ``ln``, ``e^x``.
115+
- **Trigonometric**: ``sin``, ``cos``, ``tan``, inverse trig.
116+
- **Domain-specific**: custom transforms such as baseline correction.
86117

87118
Practical Rules
88119
---------------

docs/index.rst

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,44 @@ PhysPlot: Advanced Plotting Made Simple
44
.. image:: _static/PhysPlotWide.png
55
:alt: PhysPlot logo
66
:align: center
7-
:width: 420px
7+
:width: 620px
88

99
PhysPlot is a scientific plotting software with a graphical user interface, designed to produce publication-ready 2D plots. It supports vector and bitmap outputs and allows importing, transforming, plotting, fitting, and exporting datasets.
1010

11+
Branding
12+
--------
13+
14+
PhysPlot documentation uses the official wide brand asset ``_static/PhysPlotWide.png`` on the home page and follows the project trademark policy for name and logo usage.
15+
16+
Plugin System
17+
-------------
18+
19+
PhysPlot supports plugin-based extension points for importing, transforming, and fitting data without editing core GUI files.
20+
21+
File Loader plugins
22+
~~~~~~~~~~~~~~~~~~~
23+
24+
- Add ``.py`` files to ``fileloader/`` with ``title`` and ``load_data(file_path)``.
25+
- The default loader keeps CSV/XLSX/TXT/TSV support.
26+
- Loaders are auto-discovered and appear in both:
27+
28+
- **Settings > File Loader**
29+
- The **Data Loader** dropdown above **Import Data**
30+
31+
Transform Function plugins
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
34+
- Add ``.py`` files to ``functions/`` with ``DISPLAY_NAME``, ``DEFAULT_LABEL``, and ``transform(values)``.
35+
- Built-in transform categories include identity, powers, reciprocal, logarithmic, exponential, and trigonometric operations.
36+
- Functions are auto-discovered and shown in the top-bar **Functions** menu and transform dropdown.
37+
38+
Curve-Fitting plugins
39+
~~~~~~~~~~~~~~~~~~~~~
40+
41+
- Add ``.py`` files to ``curvefitting/`` for polynomial or callable models.
42+
- Files are discovered at startup and shown in the curve-fit configuration list.
43+
- Use this for custom equations and domain-specific fitting workflows.
44+
1145
Project links
1246
-------------
1347

docs/user_guide/data_import.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@ Supported formats
66

77
- ``.txt``
88
- ``.csv``
9+
- ``.tsv``
910
- ``.xlsx``
1011

12+
Loader selection
13+
----------------
14+
15+
PhysPlot uses plugin-based file loaders. You can choose the active loader from:
16+
17+
- **Settings > File Loader**
18+
- The **Data Loader** dropdown above **Import Data**
19+
20+
Loader plugins are auto-discovered at startup from the ``fileloader/`` folder.
21+
The built-in default loader keeps standard CSV/XLSX/TXT/TSV import support.
22+
1123
Import steps
1224
------------
1325

0 commit comments

Comments
 (0)