Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheritance Structure: Tensor Fields -> Vec. Bdl. Sections #29234

Open
DeRhamSource mannequin opened this issue Feb 23, 2020 · 9 comments
Open

Inheritance Structure: Tensor Fields -> Vec. Bdl. Sections #29234

DeRhamSource mannequin opened this issue Feb 23, 2020 · 9 comments

Comments

@DeRhamSource
Copy link
Mannequin

DeRhamSource mannequin commented Feb 23, 2020

This ticket is created to establish a concise and efficient inheritance structure between sections of vector bundles and tensor fields in order to avoid or reduce code redundancies.

In this ticket, we restrict the modification to tensor fields only. The issue "vectorframes -> local frames" is devoted to another ticket (opening soon).

CC: @egourgoulhon @tscrim

Component: geometry

Keywords: tensor-bundles, vector-bundles

Issue created by migration from https://trac.sagemath.org/ticket/29234

@DeRhamSource DeRhamSource mannequin added this to the sage-9.1 milestone Feb 23, 2020
@DeRhamSource DeRhamSource mannequin added c: geometry labels Feb 23, 2020
@DeRhamSource
Copy link
Mannequin Author

DeRhamSource mannequin commented Feb 23, 2020

comment:1

It would be a shame when some documentations of tensor fields will be erased due to this task. Any suggestions how to keep them?

@egourgoulhon
Copy link
Member

comment:2

Replying to @DeRhamSource:

It would be a shame when some documentations of tensor fields will be erased due to this task. Any suggestions how to keep them?

This is certainly something to discuss (and more generally all the topic of this ticket) during your visit in Meudon in two weeks.

@tscrim
Copy link
Collaborator

tscrim commented Feb 24, 2020

comment:3

The documentation is not lost. It will just appear as links in the compiled doc (which is a bit of loss for the ? form). You can also just append it with + BaseClass.__doc__ I think, but I am not sure I would do this.

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 14, 2020

comment:4

Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.1, sage-9.2 Apr 14, 2020
@mjungmath
Copy link

comment:5

I guess, a first way to start would be to let TensorField inherit from Section since the most common code snipptes are hidden there. Then we can try to use a pattern like

def overloaded_method(self, *args, **kwargs):
    r"""
    Keep documentation and docstring
    """
    return super().overloaded_method(args, kwargs)

to keep the documentation.

Alternatively one could think about another documentation page functioning as a compendium for these kind of things.

I'd prefer the former option because this is easier for users who are not involved in the development process to follow the changes, meaning things are kept as known for them.

@egourgoulhon
Copy link
Member

comment:6

Replying to @mjungmath:

I guess, a first way to start would be to let TensorField inherit from Section since the most common code snipptes are hidden there. Then we can try to use a pattern like

def overloaded_method(self, *args, **kwargs):
    r"""
    Keep documentation and docstring
    """
    return super().overloaded_method(args, kwargs)

to keep the documentation.

This is code duplication and should be avoided IMHO.
Why not pasting the current doctests in TensorField to the EXAMPLES section of the method implemented at the section level? In this way, the end user will still discover these examples with the ? key.

@tobiasdiez
Copy link
Contributor

comment:7

As part of this refactorization, one could also extract a class representing general (pre)sheaves. This should actually not be too difficult as both implementations of sections as well as tensorfields mostly talk about the restriction of the section/tensor field to an open subset, i.e. exactly the sheaf-property.

@mjungmath
Copy link

comment:8

Replying to @tobiasdiez:

As part of this refactorization, one could also extract a class representing general (pre)sheaves. This should actually not be too difficult as both implementations of sections as well as tensorfields mostly talk about the restriction of the section/tensor field to an open subset, i.e. exactly the sheaf-property.

Actually, this is an amazing idea. This is also beneficial in the sense that we can put all preexisting examples regarding tensor fields and sections in there since they represent the most prominent examples for sheafs on manifolds. By the way, scalar fields also define sheafs and should be covered here, too.

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Aug 29, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 13, 2021

comment:10

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Feb 13, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 1, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants