Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Circular python import of SparsePoints #294

Description

@agoscinski

On the python side if one imports something from the rascal.models before importing rascal.representations one gets the following error message.

ImportError                               Traceback (most recent call last)
<ipython-input-3-939eeea548d7> in <module>
----> 1 from rascal.models import Kernel
~/lib/librascal/build/rascal/models/__init__.py in <module>
----> 1 from .sparse_points import SparsePoints
      2 from .krr import train_gap_model, KRR
      3 from .kernels import Kernel
~/lib/librascal/build/rascal/models/sparse_points.py in <module>
----> 1 from ..utils import BaseIO
      2 from ..lib._rascal.models import kernels
      3 from ..neighbourlist import AtomsList
      4 
      5 # names of existing pseudo points implementation on the pybinding side.
~/lib/librascal/build/rascal/utils/__init__.py in <module>
      5 from .io import (BaseIO, to_dict, from_dict, get_current_io_version,
      6                  get_supported_io_versions, dump_obj, load_obj)
----> 7 from .cur import CURFilter
      8 from .scorer import get_score, print_score
      9 
~/lib/librascal/build/rascal/utils/cur.py in <module>
      5                                   convert_selected_global_index2perstructure_index)
      6 
----> 7 from ..models.sparse_points import SparsePoints
      8 import numpy as np
      9 from scipy.sparse.linalg import svds
ImportError: cannot import name 'SparsePoints'

There is probably a circular import of SparsePoint happening somewhere in rascal.models which gets resolved by rascal.representations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglow-prioritynot that important, or easy workaround possible

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions