mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
Fix sip bindings for QgsStringStatisticalSummary
This commit is contained in:
parent
daabda8ca7
commit
7ae80b106d
@ -59,14 +59,16 @@ class QgsStringStatisticalSummary
|
||||
|
||||
/** Calculates summary statistics for a list of strings.
|
||||
* @param values list of strings
|
||||
* @see calculateFromVariants()
|
||||
*/
|
||||
void calculate( const QStringList& values );
|
||||
|
||||
/** Calculates summary statistics for a list of variants. Any non-string variants will be
|
||||
* ignored.
|
||||
* @param values list of variants
|
||||
* @see calculate()
|
||||
*/
|
||||
void calculate( const QVariantList& values );
|
||||
void calculateFromVariants( const QVariantList& values );
|
||||
|
||||
/** Returns the value of a specified statistic
|
||||
* @param stat statistic to return
|
||||
|
@ -54,7 +54,7 @@ void QgsStringStatisticalSummary::calculate( const QStringList& values )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsStringStatisticalSummary::calculate( const QVariantList& values )
|
||||
void QgsStringStatisticalSummary::calculateFromVariants( const QVariantList& values )
|
||||
{
|
||||
reset();
|
||||
|
||||
|
@ -79,14 +79,16 @@ class CORE_EXPORT QgsStringStatisticalSummary
|
||||
|
||||
/** Calculates summary statistics for a list of strings.
|
||||
* @param values list of strings
|
||||
* @see calculateFromVariants()
|
||||
*/
|
||||
void calculate( const QStringList& values );
|
||||
|
||||
/** Calculates summary statistics for a list of variants. Any non-string variants will be
|
||||
* ignored.
|
||||
* @param values list of variants
|
||||
* @see calculate()
|
||||
*/
|
||||
void calculate( const QVariantList& values );
|
||||
void calculateFromVariants( const QVariantList& values );
|
||||
|
||||
/** Returns the value of a specified statistic
|
||||
* @param stat statistic to return
|
||||
|
@ -67,7 +67,7 @@ class PyQgsStringStatisticalSummary(unittest.TestCase):
|
||||
def testVariantStats(self):
|
||||
s = QgsStringStatisticalSummary()
|
||||
self.assertEqual(s.statistics(), QgsStringStatisticalSummary.All)
|
||||
s.calculate(['cc', 5, 'bbbb', 'aaaa', 'eeee', 6, 9, '9', ''])
|
||||
s.calculateFromVariants(['cc', 5, 'bbbb', 'aaaa', 'eeee', 6, 9, '9', ''])
|
||||
self.assertEqual(s.count(), 6)
|
||||
self.assertEqual(set(s.distinctValues()), set(['cc', 'aaaa', 'bbbb', 'eeee', '', '9']))
|
||||
self.assertEqual(s.countMissing(), 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user