Gnm.Range

Fields

Name

Type

Access

Description

end

Gnm.CellPos

r/w

start

Gnm.CellPos

r/w

Methods

class

adtest (xs, n, p, statistics)

class

avedev (xs, n, res)

class

concatenate (data, user)

class

correl_pop (xs, ys, n, res)

class

count (xs, n, res)

class

covar_est (xs, ys, n, res)

class

covar_pop (xs, ys, n, res)

class

geometric_mean (xs, n, res)

class

harmonic_mean (xs, n, res)

class

hypot (xs, n, res)

class

kurtosis_m3_est (xs, n, res)

class

kurtosis_m3_pop (xs, n, res)

class

list_destroy (ranges)

class

mode (xs, n, res)

class

multinomial (xs, n, res)

class

product (xs, n, res)

class

rsq_pop (xs, ys, n, res)

class

simplify (arr)

class

skew_est (xs, n, res)

class

skew_pop (xs, n, res)

class

stddev_est (xs, n, res)

class

stddev_pop (xs, n, res)

class

var_est (xs, n, res)

class

var_pop (xs, n, res)

as_string ()

clip_to_finite (sheet)

compare (b)

contained (b)

dump (suffix)

dup ()

ensure_sanity (sheet)

equal (b)

fragment (b)

height ()

init (start_col, start_row, end_col, end_row)

init_cellpos (pos)

init_cellpos_size (start, cols, rows)

init_cols (sheet, start_col, end_col)

init_full_sheet (sheet)

init_rangeref (rr)

init_rows (sheet, start_row, end_row)

init_value (v)

intersection (a, b)

is_full (sheet, horiz)

is_sane ()

is_singleton ()

normalize ()

parse (text, ss)

split_ranges (soft)

translate (sheet, col_offset, row_offset)

transpose (sheet, origin)

union (b)

width ()

Details

class Gnm.Range
classmethod adtest(xs, n, p, statistics)
Parameters:
Return type:

int

classmethod avedev(xs, n, res)
Parameters:
Return type:

int

classmethod concatenate(data, user)
Parameters:
Returns:

non-zero on error.

Return type:

(int, res: str)

classmethod correl_pop(xs, ys, n, res)
Parameters:
Return type:

int

classmethod count(xs, n, res)
Parameters:
Return type:

int

classmethod covar_est(xs, ys, n, res)
Parameters:
Return type:

int

classmethod covar_pop(xs, ys, n, res)
Parameters:
Return type:

int

classmethod geometric_mean(xs, n, res)
Parameters:
Return type:

int

classmethod harmonic_mean(xs, n, res)
Parameters:
Return type:

int

classmethod hypot(xs, n, res)
Parameters:
Return type:

int

classmethod kurtosis_m3_est(xs, n, res)
Parameters:
Return type:

int

classmethod kurtosis_m3_pop(xs, n, res)
Parameters:
Return type:

int

classmethod list_destroy(ranges)
Parameters:

ranges ([Gnm.Value]) – a list of GOffice.value ranges to destroy.

Destroys a list of ranges returned from parse_cell_range_list. Note: the element type here is Gnm.Value, not Gnm.Range.

classmethod mode(xs, n, res)
Parameters:
Return type:

int

classmethod multinomial(xs, n, res)
Parameters:
Return type:

int

classmethod product(xs, n, res)
Parameters:
Return type:

int

classmethod rsq_pop(xs, ys, n, res)
Parameters:
Return type:

int

classmethod simplify(arr)
Parameters:

arr ([Gnm.Range]) – array of ranges to simplify

Returns:

array of ranges to simplify

Return type:

arr: [Gnm.Range]

Simplifies the array of ranges by merging small ranges into larger ones.

classmethod skew_est(xs, n, res)
Parameters:
Return type:

int

classmethod skew_pop(xs, n, res)
Parameters:
Return type:

int

classmethod stddev_est(xs, n, res)
Parameters:
Return type:

int

classmethod stddev_pop(xs, n, res)
Parameters:
Return type:

int

classmethod var_est(xs, n, res)
Parameters:
Return type:

int

classmethod var_pop(xs, n, res)
Parameters:
Return type:

int

as_string()
Returns:

a string representation of src

Return type:

str

clip_to_finite(sheet)
Parameters:

sheet (Gnm.Sheet) – the sheet in which self lives

Clip the range to the area of the sheet with content. if the range reaches the edge

The idea here is that users may select a whole column or Gnm.row when they really are only concerned with the extent of the sheet. On the otehr hand, if users select any smaller region they probably intend to select just that.

WARNING THIS IS EXPENSIVE!

compare(b)
Parameters:

b (Gnm.Range) – second range

Returns:

a GOffice.value that is negative if range self comes before range b; zero if the two ranges are equal; positive if range self comes after range b. The order imposed is lexicographical by starting Gnm.row, then column, then ending Gnm.row, then column. In other words, the order is A1, B1, A2, B2.

Return type:

int

contained(b)
Parameters:

b (Gnm.Range) –

Return type:

bool

Is self totally contained by b

dump(suffix)
Parameters:

suffix (str) –

dup()
Returns:

A copy of the Gnm.Range.

Return type:

Gnm.Range

Copies the self range.

ensure_sanity(sheet)
Parameters:

sheet (Gnm.Sheet) – the sheet in which self lives

Silently clip a range to ensure that it does not contain areas outside the valid bounds. Does NOT fix inverted ranges.

equal(b)
Parameters:

b (Gnm.Range) –

Return type:

bool

fragment(b)
Parameters:

b (Gnm.Range) – Second Gnm.Range

Returns:

A list of fragmented ranges or at minimum simply self and b.

Return type:

[Gnm.Range]

Fragments the ranges into totally non-overlapping regions,

height()
Returns:

height of self.

Return type:

int

init(start_col, start_row, end_col, end_row)
Parameters:
  • start_col (int) – Column

  • start_row (int) – Row

  • end_col (int) – Column

  • end_row (int) – Row

Returns:

self

Return type:

object

Updates self to start at (start_col,`start_row`) and end at (end_col,`end_row`).

init_cellpos(pos)
Parameters:

pos (Gnm.CellPos) – A Gnm.CellPos

Returns:

self

Return type:

object

Updates self to be the singleton range of pos

init_cellpos_size(start, cols, rows)
Parameters:
  • start (Gnm.CellPos) – A Gnm.CellPos for the upper left corner of the desired range

  • cols (int) – number of columns

  • rows (int) – number of rows

Returns:

self

Return type:

object

Updates self to start at start and spanning cols columns and rows rows.

init_cols(sheet, start_col, end_col)
Parameters:
Returns:

self

Return type:

object

Updates self to span full columns start_col through end_col completely.

init_full_sheet(sheet)
Parameters:

sheet (Gnm.Sheet) – Gnm.Sheet

Returns:

self

Return type:

object

Updates self to GOffice.fill sheet in its entirety.

init_rangeref(rr)
Parameters:

rr (Gnm.RangeRef) – Gnm.RangeRef

Returns:

self

Return type:

object

Updates self to be the same as the range part of rr.

init_rows(sheet, start_row, end_row)
Parameters:
Returns:

self

Return type:

object

Updates self to span full rows start_row through end_row completely.

init_value(v)
Parameters:

v (Gnm.Value) – A Gnm.Value containing a cell range

Returns:

self

Return type:

object

Updates self to be the same as the cell range of v.

intersection(a, b)
Parameters:
Returns:

True if the ranges intersect, False otherwise

Return type:

bool

This computes the intersection of two ranges; on a Venn diagram this would be A (upside down U) B. If the ranges do not intersect, false is returned an the values of self are unpredictable.

NB. totally commutative

is_full(sheet, horiz)
Parameters:
  • sheet (Gnm.Sheet) – the sheet in which self lives

  • horiz (bool) – True to check for a horizontal full ref (all _cols_); False to check for a vertical full ref (all _rows_).

Returns:

True if it is infinite, False otherwise.

Return type:

bool

This determines whether self completely spans a sheet in the dimension specified by horiz.

is_sane()
Return type:

bool

Generate warnings if the range is out of bounds or inverted.

is_singleton()
Returns:

True if self is a single-cell range.

Return type:

bool

normalize()

Ensures that start <= end for rows and cols.

parse(text, ss)
Parameters:
Returns:

True on success.

Return type:

bool

Parse a simple range (no abs/rel refs, no sheet refs) Store the result in self.

split_ranges(soft)
Parameters:

soft (Gnm.Range) – The region that is split

Returns:

A list of fragments.

Return type:

[Gnm.Range]

Splits soft into several chunks, and returns the still overlapping remainder of soft as the first list item (the central region in the pathological case).

translate(sheet, col_offset, row_offset)
Parameters:
  • sheet (Gnm.Sheet) – the sheet in which self lives

  • col_offset (int) –

  • row_offset (int) –

Returns:

True if the range is no longer valid.

Return type:

bool

Translate the range and return True if it is invalidated.

transpose(sheet, origin)
Parameters:
  • sheet (Gnm.Sheet) – the sheet in which self lives

  • origin (Gnm.CellPos) – The box to transpose inside

Returns:

whether we clipped the range.

Return type:

bool

Effectively mirrors the ranges in ‘boundary’ around a leading diagonal projected from offset.

union(b)
Parameters:

b (Gnm.Range) – range b

Returns:

the union

Return type:

Gnm.Range

This computes the union; on a Venn diagram this would be A U B NB. totally commutative. Also, this may include cells not in either range since it must return a Gnm.Range.

width()
Returns:

width of self.

Return type:

int