Skip to content

Commit 264c902

Browse files
arnaud-morvan3nids
authored andcommitted
Sypify core.QgsHistogram
1 parent 8e61d48 commit 264c902

File tree

2 files changed

+80
-35
lines changed

2 files changed

+80
-35
lines changed

python/auto_sip.blacklist

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ core/qgsgeometrysimplifier.sip
1414
core/qgsgeometryvalidator.sip
1515
core/qgsgml.sip
1616
core/qgsgmlschema.sip
17-
core/qgshistogram.sip
1817
core/qgsmaptopixelgeometrysimplifier.sip
1918
core/qgstransaction.sip
2019
core/qgstransactiongroup.sip

python/core/qgshistogram.sip

+80-34
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,106 @@
1-
/** \ingroup core
2-
* \class QgsHistogram
3-
* \brief Calculator for a numeric histogram from a list of values.
4-
*
5-
* \note Added in version 2.9
6-
*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgshistogram.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
715

816
class QgsHistogram
917
{
18+
%Docstring
19+
Calculator for a numeric histogram from a list of values.
20+
21+
.. versionadded:: 2.9
22+
%End
23+
1024
%TypeHeaderCode
1125
#include "qgshistogram.h"
1226
%End
13-
1427
public:
1528

1629
QgsHistogram();
1730

1831
virtual ~QgsHistogram();
1932

20-
/** Assigns numeric source values for the histogram.
21-
* @param values list of doubles
22-
*/
2333
void setValues( const QList<double> &values );
34+
%Docstring
35+
Assigns numeric source values for the histogram.
36+
\param values list of doubles
37+
%End
2438

2539
bool setValues( const QgsVectorLayer *layer, const QString &fieldOrExpression, QgsFeedback *feedback = 0 );
40+
%Docstring
41+
Assigns numeric source values for the histogram from a vector layer's field or as the
42+
result of an expression.
43+
\param layer vector layer
44+
\param fieldOrExpression field name or expression to be evaluated
45+
\param feedback optional feedback object to allow cancelation of calculation
46+
:return: true if values were successfully set
47+
:rtype: bool
48+
%End
2649

27-
/** Calculates the optimal bin width using the Freedman-Diaconis rule. Bins widths are
28-
* determined by the inter-quartile range of values and the number of values.
29-
* @returns optimal width for bins
30-
* @see optimalNumberBins
31-
* @note values must first be specified using @link setValues @endlink
32-
*/
3350
double optimalBinWidth() const;
51+
%Docstring
52+
Calculates the optimal bin width using the Freedman-Diaconis rule. Bins widths are
53+
determined by the inter-quartile range of values and the number of values.
54+
:return: optimal width for bins
55+
.. seealso:: optimalNumberBins
56+
.. note::
57+
58+
values must first be specified using setValues()
59+
:rtype: float
60+
%End
3461

35-
/** Returns the optimal number of bins for the source values, calculated using the
36-
* Freedman-Diaconis rule. The number of bins are determined by the inter-quartile range
37-
* of values and the number of values.
38-
* @returns optimal number of bins
39-
* @see optimalBinWidth
40-
* @note values must first be specified using @link setValues @endlink
41-
*/
4262
int optimalNumberBins() const;
63+
%Docstring
64+
Returns the optimal number of bins for the source values, calculated using the
65+
Freedman-Diaconis rule. The number of bins are determined by the inter-quartile range
66+
of values and the number of values.
67+
:return: optimal number of bins
68+
.. seealso:: optimalBinWidth
69+
.. note::
70+
71+
values must first be specified using setValues()
72+
:rtype: int
73+
%End
4374

44-
/** Returns a list of edges for the histogram for a specified number of bins. This list
45-
* will be length bins + 1, as both the first and last value are also included.
46-
* @param bins number of bins
47-
* @return list of bin edges
48-
* @note values must first be specified using @link setValues @endlink
49-
*/
5075
QList<double> binEdges( int bins ) const;
76+
%Docstring
77+
Returns a list of edges for the histogram for a specified number of bins. This list
78+
will be length bins + 1, as both the first and last value are also included.
79+
\param bins number of bins
80+
:return: list of bin edges
81+
.. note::
82+
83+
values must first be specified using setValues()
84+
:rtype: list of float
85+
%End
5186

52-
/** Returns the calculated list of the counts for the histogram bins.
53-
* @param bins number of histogram bins
54-
* @return list of histogram counts
55-
* @note values must first be specified using @link setValues @endlink
56-
*/
5787
QList<int> counts( int bins ) const;
88+
%Docstring
89+
Returns the calculated list of the counts for the histogram bins.
90+
\param bins number of histogram bins
91+
:return: list of histogram counts
92+
.. note::
93+
94+
values must first be specified using setValues()
95+
:rtype: list of int
96+
%End
5897

5998
};
6099

100+
/************************************************************************
101+
* This file has been generated automatically from *
102+
* *
103+
* src/core/qgshistogram.h *
104+
* *
105+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
106+
************************************************************************/

0 commit comments

Comments
 (0)