Opened 3 months ago

Closed 3 months ago

#30274 closed enhancement (fixed)

Immutability of Tensor Fields

Reported by: gh-mjungmath Owned by:
Priority: major Milestone: sage-9.2
Component: manifolds Keywords: immutability
Cc: egourgoulhon, tscrim, mkoeppe Merged in:
Authors: Michael Jung Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: 1b599b2 (Commits) Commit: 1b599b2871b327dfe64acb355d0fbae135f0ca97
Dependencies: #30181 Stopgaps:

Description (last modified by gh-mjungmath)

See #30261.

The immutability behavior for tensor fields appears a little bit tricky.

Change History (13)

comment:1 Changed 3 months ago by gh-mjungmath

  • Cc egourgoulhon tscrim mkoeppe added
  • Component changed from PLEASE CHANGE to manifolds
  • Description modified (diff)
  • Keywords immutability added
  • Type changed from PLEASE CHANGE to enhancement

comment:2 Changed 3 months ago by gh-mjungmath

  • Branch set to u/gh-mjungmath/immutability_of_tensor_fields

comment:3 Changed 3 months ago by gh-mjungmath

  • Commit set to 0ba933a0b0aa4734e979f0e22b6d458790ff0d49
  • Status changed from new to needs_review

New commits:

286d3c6FreeModuleTensor, Vector: Subclass a new class ModuleElementWithMutability
9df3d22sage.tensor.modules: Make all zero() and one() elements immutable
4373ea2FreeModuleTensor: Replace special casing of the immutable zero by is_immutable
a2ee8beModuleElementWithMutability.is_immutable, is_mutable: Change def to cpdef
fa6bd69Trac #30274: Merge branch 't/30181/immutable_elements_of_freemoduletensor' into t/30274/immutability_of_tensor_fields
0ba933aTrac #30274: first trial of immutability

comment:4 Changed 3 months ago by gh-mjungmath

  • Authors set to Michael Jung

comment:5 Changed 3 months ago by gh-mjungmath

Let's wait for the patchbot.

I had to make some modifications for automorphism fields. My doctests all passed.

comment:6 Changed 3 months ago by gh-mjungmath

  • Dependencies set to #30181

comment:7 Changed 3 months ago by gh-mjungmath

  • Description modified (diff)

comment:8 Changed 3 months ago by git

  • Commit changed from 0ba933a0b0aa4734e979f0e22b6d458790ff0d49 to 1b599b2871b327dfe64acb355d0fbae135f0ca97

Branch pushed to git repo; I updated commit sha1. New commits:

1b599b2Trac #30274: patchbot complaints fixed

comment:9 Changed 3 months ago by mkoeppe

  • Reviewers set to Matthias Koeppe
  • Status changed from needs_review to positive_review

LGTM.

comment:10 follow-up: Changed 3 months ago by mkoeppe

A quick remark: You define a copy method here (and looking through sage.manifolds I see several copy methods). You may want to consider (on a separate ticket) to provide __copy__ methods as well.

comment:11 in reply to: ↑ 10 Changed 3 months ago by gh-mjungmath

Thank you for the review.

Replying to mkoeppe:

A quick remark: You define a copy method here (and looking through sage.manifolds I see several copy methods). You may want to consider (on a separate ticket) to provide __copy__ methods as well.

What is the difference, or what is the advantage?

comment:13 Changed 3 months ago by vbraun

  • Branch changed from u/gh-mjungmath/immutability_of_tensor_fields to 1b599b2871b327dfe64acb355d0fbae135f0ca97
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.