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

Speed up constructing high-dimensional Euclidean spaces #30061

Closed
mkoeppe opened this issue Jul 4, 2020 · 69 comments
Closed

Speed up constructing high-dimensional Euclidean spaces #30061

mkoeppe opened this issue Jul 4, 2020 · 69 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 4, 2020

The n-dimensional Euclidean space is available in Sage in many variants.

This ticket brings the speed of the most basic operation (constructing the space) of EuclideanSpace (from sage-manifolds) closer to that of the other variants.

Spaces without scalar product:

sage: VectorSpace(QQ, 5).category()
Category of finite dimensional vector spaces with basis over (number fields and quotient fields and metric spaces)
sage: %time VectorSpace(QQ, 5)
CPU times: user 28 µs, sys: 9 µs, total: 37 µs
Wall time: 40.1 µs
Vector space of dimension 5 over Rational Field
sage: %time VectorSpace(QQ, 80)
CPU times: user 218 µs, sys: 1 µs, total: 219 µs
Wall time: 223 µs
Vector space of dimension 80 over Rational Field
sage: %time VectorSpace(QQ, 1000)
CPU times: user 208 µs, sys: 1 µs, total: 209 µs
Wall time: 213 µs
Vector space of dimension 1000 over Rational Field

sage: for n in 5, 80, 1000, 4000, 10000, 100000: print("n = {}".format(n)); print("Construction: ", timeit("V = VectorSpace(QQ, {})".format(n),number=1,repeat=1)); u = [ x for x i
....: n range(n) ]; v = [ x + 1 for x in range(n) ]; V = VectorSpace(QQ, n); print("Distance:     ", timeit("norm(V(u) - V(v))"))
n = 5
Construction:  1 loop, best of 1: 56.1 ms per loop
Distance:      625 loops, best of 3: 81.7 μs per loop
n = 80
Construction:  1 loop, best of 1: 159 μs per loop
Distance:      625 loops, best of 3: 299 μs per loop
n = 1000
Construction:  1 loop, best of 1: 236 μs per loop
Distance:      125 loops, best of 3: 3.18 ms per loop
n = 4000
Construction:  1 loop, best of 1: 147 μs per loop
Distance:      25 loops, best of 3: 11.3 ms per loop
n = 10000
Construction:  1 loop, best of 1: 149 μs per loop
Distance:      25 loops, best of 3: 28.7 ms per loop
n = 100000
Construction:  1 loop, best of 1: 162 μs per loop
Distance:      5 loops, best of 3: 296 ms per loop
sage: CombinatorialFreeModule(QQ, range(5)).category()
Category of finite dimensional vector spaces with basis over Rational Field
sage: %time CombinatorialFreeModule(QQ, range(5))
CPU times: user 80 µs, sys: 0 ns, total: 80 µs
Wall time: 86.1 µs
Free module generated by {0, 1, 2, 3, 4} over Rational Field
sage: %time CombinatorialFreeModule(QQ, range(80))
CPU times: user 244 µs, sys: 10 µs, total: 254 µs
Wall time: 259 µs
Free module generated by {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79} over Rational Field
sage: %time CombinatorialFreeModule(QQ, range(1000))
CPU times: user 322 µs, sys: 26 µs, total: 348 µs
Wall time: 354 µs
sage: AffineSpace(RR, 5).category()
Category of schemes over Real Field with 53 bits of precision

sage: %time AffineSpace(RR, 5)
CPU times: user 47 µs, sys: 1 µs, total: 48 µs
Wall time: 51 µs
Affine Space of dimension 5 over Real Field with 53 bits of precision
sage: %time AffineSpace(RR, 80)
CPU times: user 2 ms, sys: 39 µs, total: 2.04 ms
Wall time: 2.04 ms
Affine Space of dimension 80 over Real Field with 53 bits of precision
sage: %time AffineSpace(RR, 1000)
CPU times: user 62.8 ms, sys: 1.45 ms, total: 64.3 ms
Wall time: 63.5 ms
Affine Space of dimension 1000 over Real Field with 53 bits of precision

Spaces with scalar product:

sage: VectorSpace(QQ, 5, inner_product_matrix=matrix.identity(5)).category()
Category of finite dimensional vector spaces with basis over (number fields and quotient fields and metric spaces)
sage: %time VectorSpace(QQ, 5, inner_product_matrix=matrix.identity(5))
CPU times: user 6.55 ms, sys: 666 µs, total: 7.22 ms
Wall time: 6.88 ms
Ambient quadratic space of dimension 5 over Rational Field
Inner product matrix:
[1 0 0 0 0]
[0 1 0 0 0]
[0 0 1 0 0]
[0 0 0 1 0]
[0 0 0 0 1]
sage: %time VectorSpace(QQ, 80, inner_product_matrix=matrix.identity(80))
CPU times: user 14.1 ms, sys: 439 µs, total: 14.6 ms
Wall time: 14.4 ms
Ambient quadratic space of dimension 80 over Rational Field
Inner product matrix:
sage: %time VectorSpace(QQ, 1000, inner_product_matrix=matrix.identity(1000))
CPU times: user 1.44 s, sys: 34.4 ms, total: 1.47 s
Wall time: 1.48 s
Ambient quadratic space of dimension 1000 over Rational Field
Inner product matrix: ...

sage: for n in 5, 80, 1000, 4000: print("n = {}".format(n)); print("Construction: ", timeit("V = VectorSpace(QQ, {}, inner_product_matrix=matrix.identity({}))".format(n, n),number=1,repeat=1)); u = [ x for x in range(n) ]; v = [ x + 1 for x in range(n) ]; V = VectorSpace(QQ, n, inner_product_matrix=matrix.identity(n)); print("Distance:     ", timeit("t = V(u)-V(v); sqrt(t.inner_product(t))"))
n = 5
Construction:  1 loop, best of 1: 61.9 ms per loop
Distance:      625 loops, best of 3: 49.4 μs per loop
n = 80
Construction:  1 loop, best of 1: 9.75 ms per loop
Distance:      625 loops, best of 3: 243 μs per loop
n = 1000
Construction:  1 loop, best of 1: 1.51 s per loop
Distance:      25 loops, best of 3: 14.4 ms per loop
n = 4000
Construction:  1 loop, best of 1: 23.8 s per loop
Distance:      5 loops, best of 3: 225 ms per loop

NB: It is not in the category MetricSpaces, and thus the element methods dist and abs (?!) are missing... The methods __abs__, norm, and dot_product are unrelated to the inner product matrix; only inner_product uses inner_product_matrix.

sage: EuclideanSpace(5).category()
Category of smooth manifolds over Real Field with 53 bits of precision

sage: %time EuclideanSpace(5)
CPU times: user 177 ms, sys: 10.4 ms, total: 187 ms
Wall time: 196 ms
5-dimensional Euclidean space E^5
sage: %time EuclideanSpace(80)
CPU times: user 32.8 s, sys: 758 ms, total: 33.6 s
Wall time: 31.5 s
80-dimensional Euclidean space E^80
sage: %time EuclideanSpace(1000)
(timeout)

With this ticket (and its dependencies #30065, #30074):

sage: %time EuclideanSpace(5)
CPU times: user 4.87 ms, sys: 372 µs, total: 5.24 ms
Wall time: 4.93 ms
5-dimensional Euclidean space E^5
sage: %time EuclideanSpace(80)
CPU times: user 106 ms, sys: 4.52 ms, total: 110 ms
Wall time: 92 ms
80-dimensional Euclidean space E^80
sage: %time EuclideanSpace(1000)
CPU times: user 1.04 s, sys: 33.5 ms, total: 1.07 s
Wall time: 986 ms

Some caching is happening too. The second time:

sage: %time EuclideanSpace(1000)
CPU times: user 207 ms, sys: 5.63 ms, total: 213 ms
Wall time: 212 ms
1000-dimensional Euclidean space E^1000

Scalar product without a space:

sage: %time DiagonalQuadraticForm(QQ, [1]*5)
CPU times: user 60 µs, sys: 1e+03 ns, total: 61 µs
Wall time: 62.9 µs
Quadratic form in 5 variables over Rational Field with coefficients: 
[ 1 0 0 0 0 ]
[ * 1 0 0 0 ]
[ * * 1 0 0 ]
[ * * * 1 0 ]
[ * * * * 1 ]
sage: %time DiagonalQuadraticForm(QQ, [1]*80)
CPU times: user 1.35 ms, sys: 31 µs, total: 1.39 ms
Wall time: 1.44 ms
Quadratic form in 80 variables over Rational Field with coefficients: 
sage: %time DiagonalQuadraticForm(QQ, [1]*1000)
CPU times: user 144 ms, sys: 2.85 ms, total: 147 ms
Wall time: 147 ms
Quadratic form in 1000 variables over Rational Field with coefficients: 

Depends on #30065
Depends on #30074

CC: @egourgoulhon @tscrim @nbruin @mwageringel @mjungmath

Component: geometry

Author: Eric Gourgoulhon

Branch/Commit: 3ce0c15

Reviewer: Matthias Koeppe

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

@mkoeppe mkoeppe added this to the sage-9.2 milestone Jul 4, 2020
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 4, 2020

comment:1

Most of the time spent seems to come from SR (Maxima). Is it possible to speed things up for this easy special case, avoiding symbolic computation completely?

@egourgoulhon
Copy link
Member

comment:2

EuclideanSpace(n) creates the following objects:

  1. a real smooth manifold E of dimension n
  2. a chart X on E, representing the Cartesian coordinates
  3. the coordinate vector frame associated with X
  4. a Riemannian metric g on E, with its components w.r.t. X initialized to diag(1,1,...,1)
  5. the Levi-Civita connection associated with g, with its components w.r.t. X initialized to 0

Most of the CPU time is spent in step 2, actually in creating the symbolic variables (elements of SR) representing the Cartesian coordinates. The latter operation is equivalent to

sage: def create_coords(n):
....:     coords = SR.var(["x{}".format(i) for i in range(n)], domain='real')
....:     for x in coords:
....:         assume(x, 'real')

and we have:

sage: %time EuclideanSpace(5)
CPU times: user 345 ms, sys: 28 ms, total: 373 ms
Wall time: 373 ms
5-dimensional Euclidean space E^5
sage: %time create_coords(5)
CPU times: user 456 ms, sys: 338 µs, total: 456 ms
Wall time: 402 ms
sage: %time EuclideanSpace(20)
CPU times: user 3.66 s, sys: 58.9 ms, total: 3.72 s
Wall time: 3.48 s
20-dimensional Euclidean space E^20
sage: %time create_coords(20)
CPU times: user 3.38 s, sys: 75.3 ms, total: 3.45 s
Wall time: 3.21 s
sage: %time EuclideanSpace(40)
CPU times: user 12.6 s, sys: 253 ms, total: 12.8 s
Wall time: 11.9 s
40-dimensional EuclideanSR.var(["x{}".format(i) for i in range(n)], space E^40
sage: %time create_coords(40)
CPU times: user 12.2 s, sys: 226 ms, total: 12.5 s
Wall time: 11.4 s

Actually, it turns out that what takes most of CPU time is demanding that the symbolic variables are real. Indeed, if we skip domain='real' and assume(x, 'real') (each uses roughly half of the CPU time and, although they look redundant, both are actually necessary for efficient simplifications), we get very small times:

sage: %time coords = SR.var(["x{}".format(i) for i in range(40)])
CPU times: user 336 µs, sys: 9 µs, total: 345 µs
Wall time: 350 µs

I don't know why SR.var('x', domain='real') and assume(x, 'real') are so slow...

NB: in the current setting, chart coordinates are stored as SR variables; but since SymPy can be used as the symbolic backend on manifolds, via

sage: E = EuclideanSpace(5)
sage: E.set_calculus_method('sympy')

chart coordinates could be stored as SymPy variables, instead of SR ones.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 4, 2020

comment:3

Thanks very much for the explanation and analysis!

Replying to @egourgoulhon:

I don't know why SR.var('x', domain='real') and assume(x, 'real') are so slow...

I have created #30065 for this

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 4, 2020

comment:4

Replying to @egourgoulhon:

in the current setting, chart coordinates are stored as SR variables; but since SymPy can be used as the symbolic backend on manifolds, via

sage: E = EuclideanSpace(5)
sage: E.set_calculus_method('sympy')

chart coordinates could be stored as SymPy variables, instead of SR ones.

Thanks, I'll try this.

Actually, would it make sense (at least for simple cases) to have a calculus method that only uses Sage's rational functions?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 4, 2020

comment:5

In a related direction, would it be of interest to have a category of "algebraic" differential manifolds, as a differential geometry view on real varieties and semialgebraic sets (and their boundaries)?

@egourgoulhon
Copy link
Member

comment:6

Replying to @mkoeppe:

Replying to @egourgoulhon:

in the current setting, chart coordinates are stored as SR variables; but since SymPy can be used as the symbolic backend on manifolds, via

sage: E = EuclideanSpace(5)
sage: E.set_calculus_method('sympy')

chart coordinates could be stored as SymPy variables, instead of SR ones.

Thanks, I'll try this.

Actually, would it make sense (at least for simple cases) to have a calculus method that only uses Sage's rational functions?

Yes, as soon as you don't have to take a square root, as for instance in evaluating the volume n-form on a pseudo-Riemannian manifold (aka Levi-Civita tensor). In particular, this would forbid the computation of the triple scalar product within spherical coordinates in the Euclidean 3-space.

Actually, it should be relatively easy to add a new calculus method, in addition to the two ones already implemented (SR and SymPy), via the classes CalculusMethod and ChartFunction.

@egourgoulhon
Copy link
Member

comment:7

Replying to @mkoeppe:

In a related direction, would it be of interest to have a category of "algebraic" differential manifolds, as a differential geometry view on real varieties and semialgebraic sets (and their boundaries)?

Yes, I think so.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 5, 2020

comment:8

Replying to @egourgoulhon:

Actually, would it make sense (at least for simple cases) to have a calculus method that only uses Sage's rational functions?

Yes, as soon as you don't have to take a square root, as for instance in evaluating the volume n-form on a pseudo-Riemannian manifold (aka Levi-Civita tensor). In particular, this would forbid the computation of the triple scalar product within spherical coordinates in the Euclidean 3-space.

Actually, it should be relatively easy to add a new calculus method, in addition to the two ones already implemented (SR and SymPy), via the classes CalculusMethod and ChartFunction.

Thanks! I have created #30070 for this.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 5, 2020

comment:9

Replying to @egourgoulhon:

Replying to @mkoeppe:

In a related direction, would it be of interest to have a category of "algebraic" differential manifolds, as a differential geometry view on real varieties and semialgebraic sets (and their boundaries)?

Yes, I think so.

OK, I have created #30069 for the case of real algebraic manifolds.

Does sage-manifolds currently implement manifolds with boundary, or is it planned to implement them?

@egourgoulhon
Copy link
Member

comment:10

Replying to @egourgoulhon:

Replying to @mkoeppe:

Actually, would it make sense (at least for simple cases) to have a calculus method that only uses Sage's rational functions?

Yes, as soon as you don't have to take a square root, as for instance in evaluating the volume n-form on a pseudo-Riemannian manifold (aka Levi-Civita tensor). In particular, this would forbid the computation of the triple scalar product within spherical coordinates in the Euclidean 3-space.

Actually, for spherical coordinates, there is already some issue with rational functions at the level of the metric tensor itself, since the components of the Euclidean metric involve the sine function.

@egourgoulhon
Copy link
Member

comment:11

Replying to @mkoeppe:

OK, I have created #30069 for the case of real algebraic manifolds.

Very good.

Does sage-manifolds currently implement manifolds with boundary, or is it planned to implement them?

No, manifolds with boundary are not implemented yet; it would be nice to have them.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 6, 2020

comment:12

With #30065 and #30074:

sage: %prun EuclideanSpace(1000)

         53513603 function calls (53508842 primitive calls) in 37.037 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  2002006    4.658    0.000    4.786    0.000 tensorfield.py:684(_del_restrictions)
  3003010    3.263    0.000    3.766    0.000 tensorfield.py:667(_del_derived)
  2002000    3.076    0.000   18.325    0.000 free_module_tensor.py:1191(_set_comp_unsafe)
  2002000    3.047    0.000   25.990    0.000 tensorfield_paral.py:820(set_comp)
  2002000    2.571    0.000   22.942    0.000 free_module_tensor.py:1263(set_comp)
  2002000    2.478    0.000    7.194    0.000 comp.py:864(__setitem__)
  2002000    2.147    0.000    2.147    0.000 free_module_tensor.py:1474(del_other_comp)
  2003000    2.029    0.000    2.398    0.000 comp.py:616(_check_indices)
  2002000    1.825    0.000   20.150    0.000 tensorfield_paral.py:730(_set_comp_unsafe)
  2002006    1.697    0.000    9.256    0.000 tensorfield_paral.py:708(_del_derived)
        1    1.532    1.532   36.171   36.171 free_module_basis.py:566(__init__)
  1002000    1.095    0.000    1.108    0.000 scalarfield.py:1154(is_trivial_zero)
  1001003    0.931    0.000    7.942    0.000 vectorfield.py:1612(_del_derived)
  8071534    0.813    0.000    0.813    0.000 {built-in method builtins.isinstance}
        1    0.722    0.722   15.342   15.342 free_module_basis.py:375(__init__)
  1001003    0.675    0.000    0.675    0.000 vectorfield.py:292(_del_dependencies)
  2004002    0.656    0.000    0.656    0.000 finite_rank_free_module.py:2037(irange)
  1001000    0.603    0.000    5.144    0.000 diff_form.py:1241(_del_derived)
     6800    0.532    0.000    0.598    0.000 maxima_lib.py:412(_eval_line)
  2045310    0.378    0.000    0.378    0.000 {built-in method builtins.hasattr}
  1001003    0.335    0.000    5.137    0.000 multivectorfield.py:966(_del_derived)
  5005023    0.334    0.000    0.334    0.000 {method 'clear' of 'dict' objects}

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title EuclideanSpace constructor is slow Constructing Euclidean spaces, many variants Jul 6, 2020
@mkoeppe

This comment has been minimized.

@egourgoulhon

This comment has been minimized.

@egourgoulhon
Copy link
Member

comment:16

Replying to @mkoeppe:

Regarding the new ticket description, I would not say that the first three examples, namely VectorSpace(QQ, 5), CombinatorialFreeModule(QQ, range(5)) and AffineSpace(RR, 5) do construct an Euclidean space, because their ouputs are not endowed with a scalar product, are they?

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 6, 2020

comment:17

Of course, I agree. The summary already showed the categories of the spaces, but I've added two headers to emphasize this point.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 6, 2020

comment:18

Replying to @egourgoulhon:

Replying to @mkoeppe:

Does sage-manifolds currently implement manifolds with boundary, or is it planned to implement them?

No, manifolds with boundary are not implemented yet; it would be nice to have them.

I have created #30080 for this

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 7, 2020

Dependencies: #30065, #30074

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 7, 2020

comment:21

For further speedups of EuclideanSpace(1000), it seems one would need to work on
sage.tensor.modules.free_module_basis.FreeModuleCoBasis.__init__ and FreeModuleBasis.__init__. They dominate the computation now, using non-sparse operations, calling sage.manifolds.differentiable.tensorfield_paral.TensorFieldParal.set_comp 10002 times. Does it make sense to make this sparse in some way? Would major speedups be expected from cythonizing this module?

@egourgoulhon
Copy link
Member

comment:22

Replying to @mkoeppe:

For further speedups of EuclideanSpace(1000), it seems one would need to work on
sage.tensor.modules.free_module_basis.FreeModuleCoBasis.__init__ and FreeModuleBasis.__init__. They dominate the computation now, using non-sparse operations, calling sage.manifolds.differentiable.tensorfield_paral.TensorFieldParal.set_comp 10002 times. Does it make sense to make this sparse in some way?

Yes, actually in the current framework, any uninitialized component of a vector/tensor is considered to be zero. So in FreeModuleBasis.__init__, we could skip the loop initializing the components of the basis vector to zero:

        for i in fmodule.irange():
            v = fmodule.element_class(fmodule)
-           for j in fmodule.irange():
-               v.set_comp(self)[j] = fmodule._ring.zero()
            v.set_comp(self)[i] = fmodule._ring.one()
            vl.append(v)

This would make the number of calls to TensorFieldParal.set_comp to be 1000, instead in of 10002 !
Similarly in FreeModuleCoBasis.__init_:

        for i in self._fmodule.irange():
            v = self._fmodule.linear_form()
-           for j in self._fmodule.irange():
-               v.set_comp(basis)[j] = 0
-           v.set_comp(basis)[i] = 1
+           v.set_comp(basis)[i] = self._fmodule._ring.one()
            vl.append(v)

The above unnecessary initializations to zero have been implemented at the early stage of the manifolds project, when we were not certain to keep the storage convention of having uninitialized components to be zero. Given the heavy use of that convention now, it's pretty safe to remove these lines.

@egourgoulhon
Copy link
Member

@egourgoulhon
Copy link
Member

comment:23

The changes suggested in comment:22 are implemented in the above branch.


New commits:

fccbf43Improve initialization of elements of a free module basis

@mjungmath
Copy link

comment:50

Can you please briefly summarize in the description what has actually been done and what the new benefits are? It is very difficult for me to piece that all together just from the comments and cross references to other tickets. Thanks! :)

In general, I would wait until the dependent tickets are merged. However, I am a bad role model due to my impatience.

@egourgoulhon
Copy link
Member

comment:52

Replying to @mkoeppe:

Should we set this ticket to "needs_review"?

Yes, indeed.

@egourgoulhon
Copy link
Member

comment:53

Replying to @mjungmath:

Can you please briefly summarize in the description what has actually been done and what the new benefits are? It is very difficult for me to piece that all together just from the comments and cross references to other tickets. Thanks! :)

The code added in this ticket is described in comment:22 and comment:23.
The other code in the ticket branch arises from the dependencies tickets #30065 and #30074.

@mjungmath
Copy link

comment:54

Replying to @egourgoulhon:

The code added in this ticket is described in comment:22 and comment:23.
The other code in the ticket branch arises from the dependencies tickets #30065 and #30074.

Thanks!

@mkoeppe mkoeppe changed the title Constructing Euclidean spaces, many variants Speed up constructing high-dimensional Euclidean spaces Jul 15, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 19, 2020

Reviewer: Matthias Koeppe

@mjungmath
Copy link

comment:61

Patchbot not green. The latest branch of #30074 has not been merged yet.

@tscrim
Copy link
Collaborator

tscrim commented Jul 19, 2020

comment:62

That is not a real error (the other patchbot also came back green). You don't need to have all of the other branches merged in.

@mjungmath
Copy link

comment:63

Replying to @tscrim:

That is not a real error (the other patchbot also came back green).

It is a real error. Pyflakes is complaining about an unused import.

You don't need to have all of the other branches merged in.

Why is that? Wouldn't that cause a merge conflict later on?

@tscrim
Copy link
Collaborator

tscrim commented Jul 19, 2020

comment:64

Replying to @mjungmath:

Replying to @tscrim:

That is not a real error (the other patchbot also came back green).

It is a real error. Pyflakes is complaining about an unused import.

No, it is not. Pyflakes are not real errors (but they are good to clear).

You don't need to have all of the other branches merged in.

Why is that? Wouldn't that cause in a merge conflict later on?

There is no need to add unnecessary extra merge commits when there is no conflict or a need to have the latest branch. If later changes on the first branch are done to unrelated parts to the changes on this branch, there is no conflict.

Addendum - The pyflakes is handled on the later commits from #30074. So changing that here would cause a merge conflict and resolve a problem already fixed.

@mjungmath
Copy link

comment:65

Replying to @tscrim:

Replying to @mjungmath:

Replying to @tscrim:

That is not a real error (the other patchbot also came back green).

It is a real error. Pyflakes is complaining about an unused import.

No, it is not. Pyflakes are not real errors (but they are good to clear).

Okay, I see what you mean.

Replying to @tscrim:

Addendum - The pyflakes is handled on the later commits from #30074. So changing that here would cause a merge conflict and resolve a problem already fixed.

Mh. Sorry, I don't get it. The #30074 will be merged into develop first because of the dependence, right? Afterwards, this ticket will be merged. If this ticket consists of an older version than #30074, this would cause a merge conflict, wouldn't it? Or, at least, the pyflakes error would be added again.

@tscrim
Copy link
Collaborator

tscrim commented Jul 19, 2020

comment:66

Replying to @mjungmath:

Replying to @tscrim:

Addendum - The pyflakes is handled on the later commits from #30074. So changing that here would cause a merge conflict and resolve a problem already fixed.

Mh. Sorry, I don't get it. The #30074 will be merged into develop first because of the dependence, right? Afterwards, this ticket will be merged. If this ticket consists of an older version than #30074, this would cause a merge conflict, wouldn't it? Or, at least, the pyflakes error would be added again.

No. The result will look like this:

B--0--X--T----M
    \        /
     0--0--H

where T is this branch and H is the head of #30074. So the #30074 branch will be merged first (all commits marked 0 starting from the latest beta B and H), then the commits from this branch (labelled X and T), which will result in the merge commit M. This would be exactly the same as if you merged in the latest commits from #30074 because that would be doing the same thing. The only difference is you have an extra merge commit in where this branch is pointing to.

@mjungmath
Copy link

comment:67

Replying to @tscrim:

No. The result will look like this:

B--0--X--T----M
    \        /
     0--0--H

where T is this branch and H is the head of #30074. So the #30074 branch will be merged first (all commits marked 0 starting from the latest beta B and H), then the commits from this branch (labelled X and T), which will result in the merge commit M. This would be exactly the same as if you merged in the latest commits from #30074 because that would be doing the same thing. The only difference is you have an extra merge commit in where this branch is pointing to.

Ah, I see. This is because the commit in #30074 is more recent, right?

@tscrim
Copy link
Collaborator

tscrim commented Jul 19, 2020

comment:68

Replying to @mjungmath:

Ah, I see. This is because the commit in #30074 is more recent, right?

Yes, but it is still based off a common base commit.

@mjungmath
Copy link

comment:69

Replying to @tscrim:

Replying to @mjungmath:

Ah, I see. This is because the commit in #30074 is more recent, right?

Yes, but it is still based off a common base commit.

Ah well. Thank you for explaining this, and sorry for delaying the process. This is good to know for future commits of mine.

@vbraun
Copy link
Member

vbraun commented Aug 2, 2020

Changed branch from public/manifolds/init_module_basis-30061 to 3ce0c15

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