Skip to content

[Code scan] Restore vendored xitorch sampled quadrature imports #42

Description

@njzjz

This issue comes from a Codex global repository scan.

Problem

The vendored sampled quadrature module imports the vendored package root and subclasses xt.EditableModule:

import torch
import dftio.dep._xitorch as xt
from abc import abstractmethod
from dftio.dep._xitorch._impls.interpolate.interp_1d import _get_spline_mat_inv
"""
This file contains the cumulative sum quadrature functions.
The functions are usually used in solve_poisson method in grid objects.
"""
class BaseSQuad(xt.EditableModule):

But dftio/dep/_xitorch/__init__.py is empty, so EditableModule is not exported there. Importing the module raises:

AttributeError: module 'dftio.dep._xitorch' has no attribute 'EditableModule'

Suggested fix

Either import EditableModule directly from dftio.dep._xitorch._core.editable_module, or re-export it from the vendored package root.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions