Skip to content

GridCellsEncoder: simplify encode() #400

Open
@breznak

Description

@breznak

Currently, the encode expects a SDR parameter encode([x, y], sdr_gc) grid cells.

Used as:

SDR gc_sdr
Metrics(gc_sdr)
GridCellsEncoder gce
for d in data:
  gce.encode(d, gc_sdr)

I'm proposing GCE creating the SDR itself, and exposing it as a member GCE.grid_cells, so

GridCellsEncoder gce
Metrics(gce.grid_cells)
for ...:
  gce.encode([x,y])

Also consider if encode shouldn't take only x,y integer params encode(x, y),
as the 2D point/list [x,y] is the only input the encoder accepts and we have to check for it. This might be clearer.

Follow up to #353

Metadata

Metadata

Assignees

No one assigned

    Labels

    encoderenhancementNew feature or requestnewbiepythonnot py binding, but merge py code in repo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions