Skip to content

Internal call to deprecated function should be replaced #200

@hakonanes

Description

@hakonanes

Problem

Hi all!

In orix, I can silence all sources of deprecation warnings from 3.4.0 but one: two calls to expandPosition() inside diffpy.structure itself:

sites, ops, mult = expandPosition(spacegroup, xyz, sgoffset, eps)
invariants = _find_invariants(ops)
# shift self.xyz exactly to the special position
if mult > 1:
xyzdups = numpy.array([op(xyz + self.sgoffset) - self.sgoffset for op in invariants])
dxyz = xyzdups - xyz
dxyz = numpy.mean(dxyz - dxyz.round(), axis=0)
# recalculate if needed
if numpy.any(dxyz != 0.0):
self.xyz = xyz + dxyz
self.xyz[numpy.fabs(self.xyz) < self.eps] = 0.0
sites, ops, mult = expandPosition(spacegroup, self.xyz, self.sgoffset, eps)

Proposed solution

I propose to replace those two calls with expand_position().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions