Skip to content

Fixed delete spine bug #21

@cudmore

Description

@cudmore

Delete spine now seems to work.

When calling _drop(), the key param is a sting like "Spine" or "Segment", not the type def Spine

    def deleteSpine(self, spineId: Keys, skipLog=False) -> None:
        logger.info(f'spineId:{spineId}')
        # abb
        # self._drop(Spine, spineId, skipLog=skipLog)
        self._drop("Spine", spineId, skipLog=skipLog)

Fixed bug in _drop() that had syntax error using id rather than ids. Be careful as id() is a built in Python function!

    def _drop(self, key: str, ids: Union[Hashable, Sequence[Hashable], pd.Index], skipLog=False) -> None:
        store = self._frames[key]
        df = store._rootDf

        if not skipLog:
            ids = ids if isinstance(ids, pd.Index) or isinstance(
                ids, Sequence) else [ids]
            deletedData = df.loc[ids]
            self._log.push(
                Op(key, deletedData, gp.GeoDataFrame(columns=df.columns)))

        df.drop(ids, inplace=True)
        store._state.increment()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions