16 Commits

Author SHA1 Message Date
Denis Rouzaud
0f032e5f2d run pre-commit on all files 2024-11-29 15:38:02 +01:00
Nyall Dawson
c85589e52a Fix malformed docs for register_function, qgsfunction 2024-09-11 08:51:05 +02:00
Nyall Dawson
c16a1e2b3d Update enums 2024-01-19 19:44:48 +10:00
Germap
43511aced2
Update qgsfunction.py, homogenize referenced_columns subsection 2023-11-18 17:53:29 -05:00
Germap
e69f2bf0f8
Update python/core/additions/qgsfunction.py
Avoid using 'slightly' since this could be a considerable performance improvement depending on the provider.

Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
2023-11-17 17:36:23 -05:00
Germán Carrillo
ac80a3782e Avoid None as value for referenced_columns (use empty list instead) in qgsfunction.py documentation 2023-11-02 16:31:45 +01:00
Yoann Quenach de Quivillic
ccb868f626 Harmonize doc 2023-04-29 14:25:11 +02:00
Yoann Quenach de Quivillic
947931ad2b Fix qgsfunction decorator args handling 2023-04-29 14:25:11 +02:00
Hannes
1877b3634a Show full traceback on Python expression function exception 2022-02-19 09:00:34 +10:00
Matthias Kuhn
a5f557f085 Fix escaping issues 2020-05-05 23:22:12 +02:00
Juergen E. Fischer
b830a4a448 qgsfunction: replace deprecated inspect.getargspec() to inspect.getfullargspec() 2019-11-07 22:47:08 +01:00
Matthias Kuhn
a1b6a2cb7f Fix docs 2018-07-02 06:16:49 -05:00
Matthias Kuhn
45fdd0fb31 Add documentation for @qgsfunction 2018-07-01 06:31:26 -05:00
Matthias Kuhn
60730abba7 Add missing import 2018-06-30 09:40:13 -05:00
Matthias Kuhn
773138cf57 Add handlesnull parameter to @qgsfunction
Up to date it was not possible to create a function that handles NULL values with the
@qgsfunction decorator. As soon as any parameter was NULL, the return value would also
be NULL.

Example of a function that returns a value now with a NULL paramter and would have returned NULL before

```
@qgsfunction(args=-1, group='Custom', handlesnull=True)
def mean_value(vals, feature, parent):
    valid_vals = [val for val in vals if val != NULL]
    return sum(valid_vals)/len(valid_vals)
```

[FEATURE]
2018-06-30 09:40:13 -05:00
Denis Rouzaud
6e33bdcdc4 [pyqgis] move qgis.core tricks to their own python file in additions folder
this makes the code much easier to read
2018-05-14 18:00:39 -04:00