Re: [sage-devel] Voting: Block-scoped optional tag and the keyword

2023-06-29 Thread Dima Pasechnik
(A), please


On Thu, 29 Jun 2023, 03:40 Kwankyu Lee,  wrote:

> Hi,
>
> We spent six days for the preliminary discussion in the sage-devel thread
>
> https://groups.google.com/g/sage-devel/c/OUnoroIf0qc
>
> about choosing the keyword triggering block-scoped optional tag needed in
>
> https://github.com/sagemath/sage/issues/35750
>
> We now start the voting with the four candidates (A), (B), (C), (D). The
> voting will end 7th July 23:59 KST (Korea Standard Time). During the
> voting, discussions can continue in the linked places but please only your
> vote (and, if you will, short comment) to this thread.
>
> (A) "needs"
>
> sage: # needs sage.rings.number_field
> sage: QQbar(I)^2
> -1
> sage: QQbar(I)^10 # long time
> 1
>
> sage: # needs sage.rings.finite_rings
> sage: F = GF(7)
> sage: F(1) + QQbar(1)  # needs sage.rings.number_field
> ...
>
> (B) "requires"
>
> sage: # requires sage.rings.number_field
> sage: QQbar(I)^2
> -1
> sage: QQbar(I)^10  # long time
> 1
>
> sage: # requires sage.rings.finite_rings
> sage: F = GF(7)
> sage: F(1) + QQbar(1)  # requires sage.rings.number_field
> ...
>
> (C) "uses"
>
> sage: # uses sage.rings.number_field
> sage: QQbar(I)^2
> -1
> sage: QQbar(I)^10  # long time
> 1
>
> sage: # uses sage.rings.finite_rings
> sage: F = GF(7)
> sage: F(1) + QQbar(1)  # uses sage.rings.number_field
> ...
>
> (D) "standard"
>
> sage: # use standard feature - sage.rings.number_field
> sage: QQbar(I)^2
> -1
> sage: QQbar(I)^10  # long time
> 1
>
> sage: # use standard feature - sage.rings.finite_rings
> sage: F = GF(7)
> sage: F(1) + QQbar(1)  # standard - sage.rings.number_field
> ...
>
> Please just focus on the keyword. Don't worry about minor details or
> punctuations: the keyword would be recognized, the rest would be ignored
> noise, in the implementation.
>
> Thanks for your attention. Happy voting :-)
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/e3471d65-0652-4173-8eab-f5b45888c4d9n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq2pdfSC7hhH8L%3DFaxuFV7io3927byxSdx1_7XsFozMi7A%40mail.gmail.com.


[sage-devel] Re: Voting: Block-scoped optional tag and the keyword

2023-06-29 Thread Eric Gourgoulhon
I vote for (A)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/1931486a-b228-402b-b2b7-42945e3fd18dn%40googlegroups.com.


[sage-devel] New package creation - advice/help requested

2023-06-29 Thread Aram Dermenjian
Hi all,

Question for humans. I used to have a project/package for sagemath about 3 
years ago that got close to getting completed, but that I never finished. 
(See: https://github.com/thecaligarmo/oriented_matroids) I'm now at a place 
to finish it, but (since it's been almost 3 years) it seems the method I 
was using to create a new package is no longer valid. For example, when I 
try and do an install, I get the following error:

 SetuptoolsDeprecationWarning: setup.py install is deprecated. Use 
build and pip and other standards-based tools.

I'd like for this to stay a package (at least for now) for development 
purposes with a potential for it to be integrated into sagemath later on. I 
tried to use https://doc.sagemath.org/html/en/developer/packaging.html in 
order to see how the new method of creating a package was, but, to be 
honest, I found it more confusing than enlightening as it didn't actually 
how how to create a new package. (It showed how to integrate an already 
existing package into sage, but that's about it). 

Would anyone would have the time and patience to help guide me through 
and/or give me the resources so I can implement something like this?

Kinndly,
Aram Dermenjian


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/06661e5a-340c-41b8-8d98-39c874bfabb3n%40googlegroups.com.


Re: [sage-devel] Faster algorithm for order dimension

2023-06-29 Thread Maximilian Wittmann
Github issue is now under https://github.com/sagemath/sage/issues/35851
Dima Pasechnik schrieb am Dienstag, 27. Juni 2023 um 11:14:34 UTC+2:

> On Tue, Jun 27, 2023 at 4:37 AM Maximilian Wittmann  
> wrote:
> >
> > Hey everyone,
> >
> > I am currently doing my masters thesis on the dimension of cartesian 
> products of posets and believe I have stumbled upon an alternative approach 
> to calculate the dimension, that performs better than the one in sage. (No 
> published results)
> >
> > C = posets.Crown(2)
> > C2 = C.product(C)
> >
> > %time order_dimension(C2, solver="kissat")
> > CPU times: user 96.1 ms, sys: 1e+03 ns, total: 96.1 ms
> > Wall time: 302 ms
> >
> > %time C2.dimension(solver="gurobi")
> > CPU times: user 2.33 s, sys: 28 ms, total: 2.36 s
> > Wall time: 2.19 s
> >
> > b = posets.BooleanLattice(5)
> > %time order_dimension(b, solver="kissat")
> > CPU times: user 1.13 s, sys: 12 ms, total: 1.14 s
> > Wall time: 1.46 s
> >
> > #gurobi did not finish, even after waiting a couple of minutes
> >
> > The idea is to reduce order dimension to SAT in the following way:
> >
> > Let P be an arbitrary poset.
> > A linear extension of P corresponds to some orientation of the 
> incomparable pairs of P, such that transitivity constraints are satisfied. 
> So introduce a new variable x_(a,b) for each incomparable pair (a, b), 
> where the order of a and b has been arbitrarliy fixed.
> >
> > We want x_p = true iff a < b in the linear extension and x_p = false iff 
> b < a. Now for each
> > (a, c) incomparable and each b introduce a new clause (not x_(a,b) v not 
> x_(b,c) v x_(a,b)), which directly corresponds to the transitivity 
> constraints. Of course (a,b) or (b,c) may be comparable already. In this 
> case we can just set x_(a,b) to true or false and correspondingly eliminate 
> the literal or clause.
> >
> > This formulation allows us to find one linear extension. Now to find a 
> realizer of size k, take k independent copies of above CNF-Formula and add 
> additional constraints to make sure that each incomparable pair appears in 
> both orientations at least once. I.e. clauses
> > (x_(a,b),1 v x_(a,b),1 v ... v x_(a,b),k) and (not x_(a,b),1 v not 
> x_(a,b),2 v ... v not x_(a,b), k) for each incomparable pair (a,b) where 
> x_(a,b),i denotes the i-th copy of that variable.
> >
> > This formula is satisfiable iff P has a realizer of size k.
> >
> > Here is a potential implementation of this:
> > def order_dimension(self: FinitePoset, solver=None, certificate=False):
> > if self.cardinality() == 0:
> > return (0, []) if certificate else 0
> > if self.is_chain():
> > return (1, [self.list()]) if certificate else 1
> >
> > # current bound on the chromatic number of the hypergraph
> > k = 2
> > # if a realizer is not needed, we can optimize a little
> > if not certificate:
> > # polynomial time check for dimension 2
> > from sage.graphs.comparability import greedy_is_comparability as 
> is_comparability
> > if 
> is_comparability(self._hasse_diagram.transitive_closure().to_undirected().complement()):
> > return 2
> > k = 3
> > # known upper bound for dimension
> > max_value = max(self.cardinality() // 2, self.width())
> >
> > p = Poset(self._hasse_diagram)
> > elements = p.list()
> >
> > #identify incomparable pairs with variables
> > inc_graph = p.incomparability_graph()
> > inc_pairs = inc_graph.edges(sort=True, labels=False)
> > n_inc = len(inc_pairs)
> > to_variables = dict((pair, i) for (i, pair) in enumerate(inc_pairs, 
> start=1))
> >
> >
> >
> > def get_var(a, b):
> > #gets the corresponding variable for one ordered incomparable pair
> > val = to_variables.get((a, b), None)
> > if not val is None:
> > return val
> >
> > val_flip = to_variables.get((b, a), None)
> > if not val_flip is None:
> > return -val_flip
> >
> > #return None if comparable
> > return None
> >
> > # generate the clauses to form a linear extension
> > clauses = []
> > for ((a,c), ac_var) in to_variables.items():
> > for b in elements:
> > new_clause = []
> >
> > ab_var = get_var(a, b)
> > if not ab_var is None:
> > new_clause.append(-ab_var)
> > elif (not p.is_less_than(a, b)):
> > continue
> >
> > bc_var = get_var(b, c)
> > if not bc_var is None:
> > new_clause.append(-bc_var)
> > elif (not p.is_less_than(b, c)):
> > continue
> >
> > new_clause.append(ac_var)
> > clauses.append(new_clause)
> >
> >
> > from sage.sat.solvers.satsolver import SAT
> > def build_sat(k):
> > sat = SAT(solver=solver)
> > #add clauses to find k linear extensions
> > for i in range(k):
> > modifier = i * n_inc
> > for clause in clauses:
> > new_clause = [var + sign(var)*modifier for var in clause]
> > sat.add_clause(new_clause)
> > #clauses to ensure that each incomparable pair appears in both orders
> > for var in range(1, n_inc+1):
> > sat.add_clause([var + i*n_inc for i in range(k)])
> > sat.add_clause([-var - i*n_inc for i in range(k)])
> > return sat
> >
> > while True:
> > #attempt to find realizer for each k if the upper bound is not reached
>

Re: [sage-devel] New package creation - advice/help requested

2023-06-29 Thread Dima Pasechnik
I've left some comments on
https://github.com/thecaligarmo/oriented_matroids/issues/2

Basically, you'd want to create a PyPI package, a standard in Python
world thing.

On Thu, Jun 29, 2023 at 11:01 AM Aram Dermenjian
 wrote:
>
> Hi all,
>
> Question for humans. I used to have a project/package for sagemath about 3 
> years ago that got close to getting completed, but that I never finished. 
> (See: https://github.com/thecaligarmo/oriented_matroids) I'm now at a place 
> to finish it, but (since it's been almost 3 years) it seems the method I was 
> using to create a new package is no longer valid. For example, when I try and 
> do an install, I get the following error:
>
>  SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build 
> and pip and other standards-based tools.
>
> I'd like for this to stay a package (at least for now) for development 
> purposes with a potential for it to be integrated into sagemath later on. I 
> tried to use https://doc.sagemath.org/html/en/developer/packaging.html in 
> order to see how the new method of creating a package was, but, to be honest, 
> I found it more confusing than enlightening as it didn't actually how how to 
> create a new package. (It showed how to integrate an already existing package 
> into sage, but that's about it).
>
> Would anyone would have the time and patience to help guide me through and/or 
> give me the resources so I can implement something like this?
>
> Kinndly,
> Aram Dermenjian
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/06661e5a-340c-41b8-8d98-39c874bfabb3n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq2m9_3mneYjWBOYNkNQ%3DUg8pWhayuLzek%2BJ4MnvJu73tA%40mail.gmail.com.


Re: [sage-devel] New package creation - advice/help requested

2023-06-29 Thread Dima Pasechnik
On Thu, Jun 29, 2023 at 11:01 AM Aram Dermenjian
 wrote:
>
> Hi all,
>
> Question for humans. I used to have a project/package for sagemath about 3 
> years ago that got close to getting completed, but that I never finished. 
> (See: https://github.com/thecaligarmo/oriented_matroids) I'm now at a place 
> to finish it, but (since it's been almost 3 years) it seems the method I was 
> using to create a new package is no longer valid. For example, when I try and 
> do an install, I get the following error:
>
>  SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build 
> and pip and other standards-based tools.
>
> I'd like for this to stay a package (at least for now) for development 
> purposes with a potential for it to be integrated into sagemath later on. I 
> tried to use https://doc.sagemath.org/html/en/developer/packaging.html in 
> order to see how the new method of creating a package was, but, to be honest, 
> I found it more confusing than enlightening as it didn't actually how how to 
> create a new package. (It showed how to integrate an already existing package 
> into sage, but that's about it).


This part of the docs addresses a different task - on integrating your
code into Sage library, not how to
create Python packages dependent on Sage (the latter is not different
from creating a Python package with external
Python dependencies)

It would be great to have a good example of this, Sage-specific - I
don't know how good https://pypi.org/project/slabbe
is good as an example.

>
> Would anyone would have the time and patience to help guide me through and/or 
> give me the resources so I can implement something like this?
>
> Kinndly,
> Aram Dermenjian
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/06661e5a-340c-41b8-8d98-39c874bfabb3n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq1zzfA_Wd--u6eQfREidNjR75PQ9iCkoH23D3zYZ0R2MQ%40mail.gmail.com.


Re: [sage-devel] Re: Voting: Block-scoped optional tag and the keyword

2023-06-29 Thread David Roe
I vote for (A)

On Thu, Jun 29, 2023 at 5:13 AM Eric Gourgoulhon 
wrote:

> I vote for (A)
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/1931486a-b228-402b-b2b7-42945e3fd18dn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAChs6_nkpO2%3DVrQPvgthf%2BtbZUwRbT4SLpBax134BwP_akU--g%40mail.gmail.com.


Re: [sage-devel] Re: Voting: Block-scoped optional tag and the keyword

2023-06-29 Thread seb....@gmail.com
I vote for (C)

David Roe schrieb am Donnerstag, 29. Juni 2023 um 17:57:35 UTC+2:

> I vote for (A)
>
> On Thu, Jun 29, 2023 at 5:13 AM Eric Gourgoulhon  
> wrote:
>
>> I vote for (A)
>>
>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/1931486a-b228-402b-b2b7-42945e3fd18dn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/9c7efc41-e3b4-4c1e-8f1f-ef6d75d4d9c7n%40googlegroups.com.


[sage-devel] Re: New package creation - advice/help requested

2023-06-29 Thread Matthias Koeppe
On Thursday, June 29, 2023 at 3:01:58 AM UTC-7 Aram Dermenjian wrote:

it seems the method I was using to create a new package is no longer valid. 
For example, when I try and do an install, I get the following error:

 SetuptoolsDeprecationWarning: setup.py install is deprecated. Use 
build and pip and other standards-based tools.


It's not an error. If you already use "pip install" to install your 
package, no action is needed.
But you may want to learn about pyproject.toml (see the setuptools docs)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/f1096be7-a10b-489e-8e74-247c852b0982n%40googlegroups.com.


[sage-devel] flint/bootstrap.sh on the github CI workers

2023-06-29 Thread Marc Mezzarobba
Hi,

At https://github.com/sagemath/sage/pull/35848 I'm trying to make sage
build with flint3. It does build on my laptop, but autoreconf seems to
behave differently locally and on the CI VMs, and I have no idea why.
It would be great if someone with more knowledge of autotools and/or
our CI infrastructure could take a look.

Thanks,

-- 
Marc

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/u7kgjh%24mde%241%40ciao.gmane.io.


Re: [sage-devel] flint/bootstrap.sh on the github CI workers

2023-06-29 Thread Dima Pasechnik
By right, one should have a tarball not needing autotools.

Build such a tarball if flint does not provide one,
and use it.



On Thu, 29 Jun 2023, 18:56 Marc Mezzarobba,  wrote:

> Hi,
>
> At https://github.com/sagemath/sage/pull/35848 I'm trying to make sage
> build with flint3. It does build on my laptop, but autoreconf seems to
> behave differently locally and on the CI VMs, and I have no idea why.
> It would be great if someone with more knowledge of autotools and/or
> our CI infrastructure could take a look.
>
> Thanks,
>
> --
> Marc
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/u7kgjh%24mde%241%40ciao.gmane.io
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq1B%3DCAznrNd0rq4x5LNSih_OQuri3cQTST0Cp3tVhVxVA%40mail.gmail.com.


[sage-devel] Question about reading Sage documentation

2023-06-29 Thread Marc Culler
During our recent release of SnapPy we ran across an issue which is likely 
relevant to whether Sage's documentation is viewable on newer Ubuntu 
systems (such as 22.04).  The issue is that these newer Ubuntu systems ship 
Firefox as a snap.  A snap runs in a sandbox which restricts which files 
the snap can read.  Specifically, the Firefox snap can only read files in 
the user's home directory.

This would suggest that a user who builds Sage in their home directory can 
use Firefox to view the documentation by using a URL with the file: scheme, 
but that if Sage is installed for all users on a multi-user system or if it 
is installed with apt then it will not be possible for users to read the 
locally installed documentation with Firefox.  (Of course they can use 
Firefox to read the online documentation for the current SageMath version 
but, on Ubuntu, that is essentially guaranteed not to be the version that 
is actually installed.)

Have people run into this?

- Marc

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/ca8f5dbe-8b50-43e1-afaa-f2073a1e70e8n%40googlegroups.com.


Re: [sage-devel] Re: Voting: Block-scoped optional tag and the keyword

2023-06-29 Thread Nils Bruin
I vote for (A)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/a296960e-fda8-4d50-924e-179ce7934286n%40googlegroups.com.


[sage-devel] Re: Voting: Block-scoped optional tag and the keyword

2023-06-29 Thread Marc Culler
I vote for (C).

On Wednesday, June 28, 2023 at 9:40:07 PM UTC-5 Kwankyu Lee wrote:

> Hi,
>
> We spent six days for the preliminary discussion in the sage-devel thread
>
> https://groups.google.com/g/sage-devel/c/OUnoroIf0qc
>
> about choosing the keyword triggering block-scoped optional tag needed in 
>
> https://github.com/sagemath/sage/issues/35750
>
> We now start the voting with the four candidates (A), (B), (C), (D). The 
> voting will end 7th July 23:59 KST (Korea Standard Time). During the 
> voting, discussions can continue in the linked places but please only your 
> vote (and, if you will, short comment) to this thread.
>
> (A) "needs"
>
> sage: # needs sage.rings.number_field
> sage: QQbar(I)^2
> -1
> sage: QQbar(I)^10 # long time
> 1
>
> sage: # needs sage.rings.finite_rings
> sage: F = GF(7)
> sage: F(1) + QQbar(1)  # needs sage.rings.number_field
> ...
>
> (B) "requires"
>
> sage: # requires sage.rings.number_field
> sage: QQbar(I)^2
> -1
> sage: QQbar(I)^10  # long time
> 1
>
> sage: # requires sage.rings.finite_rings
> sage: F = GF(7)
> sage: F(1) + QQbar(1)  # requires sage.rings.number_field
> ...
>
> (C) "uses"
>
> sage: # uses sage.rings.number_field
> sage: QQbar(I)^2
> -1
> sage: QQbar(I)^10  # long time
> 1
>
> sage: # uses sage.rings.finite_rings
> sage: F = GF(7)
> sage: F(1) + QQbar(1)  # uses sage.rings.number_field
> ...
>
> (D) "standard"
>
> sage: # use standard feature - sage.rings.number_field
> sage: QQbar(I)^2
> -1
> sage: QQbar(I)^10  # long time
> 1
>
> sage: # use standard feature - sage.rings.finite_rings
> sage: F = GF(7)
> sage: F(1) + QQbar(1)  # standard - sage.rings.number_field
> ...
>
> Please just focus on the keyword. Don't worry about minor details or 
> punctuations: the keyword would be recognized, the rest would be ignored 
> noise, in the implementation.
>
> Thanks for your attention. Happy voting :-)
>
>
>
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/6d732a20-6a69-46b7-ac32-063b8170a8efn%40googlegroups.com.


Re: [sage-devel] Graphics files in Sage documentation

2023-06-29 Thread Dima Pasechnik
On Thu, Jun 29, 2023 at 3:24 AM Michael Orlitzky  wrote:
>
> On 2023-06-28 23:27:22, Dima Pasechnik wrote:
> > One can always start a web server on localhost, instead of using file:/// :P
> >
>
> I know you're mostly joking, but that's not as easy as it sounds.

no, why? If you run ./sage -n you'll see something like

To access the notebook, open this file in a browser:
file:///home/dima/.local/share/jupyter/runtime/nbserver-15031-open.html
Or copy and paste one of these URLs:

http://localhost:/?token=067f4b0aab24836fd21c349e9cfa2e78c29b183444e6b44d
 or 
http://127.0.0.1:/?token=067f4b0aab24836fd21c349e9cfa2e78c29b183444e6b44d

- so jupyter offers you an alternative like this. And it's very useful
if e.g. your Sage session is run in a VM-like
environment, e.g. in a Crostini container (an LXC container)  so that
the browser can't directly access files, but
HTTP has a tunnel set up.


> To
> start the local web server as a non-root user, you have to run it on
> an unprivileged (i.e. not the default of 80) port. Then you have to
> teach it about mime types and gzip, and probably add a line or two
> about image/svg+xml and the svgz extension.
>
> Then you have to secure it somehow. Other local users can hit that TCP
> port, and it will be running with your desktop user's privileges, so
> it can see all of your files. Your server might support path
> restrictions, but does it protect against the past 30 years' worth of
> path traversal hacks and stupid symlink tricks? Maybe if you're using
> apache or nginx, but if you're using "python -m http.server", I
> wouldn't count on it.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/ZJzrXxtT1lnmuywr%40stitch.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq2AuQntrb3xoeL7r7TF2uUK2QCHObu9N%3DUyewiOf18H6Q%40mail.gmail.com.


Re: [sage-devel] Question about reading Sage documentation

2023-06-29 Thread Dima Pasechnik
On Thu, Jun 29, 2023 at 10:46 PM Marc Culler  wrote:
>
> During our recent release of SnapPy we ran across an issue which is likely 
> relevant to whether Sage's documentation is viewable on newer Ubuntu systems 
> (such as 22.04).  The issue is that these newer Ubuntu systems ship Firefox 
> as a snap.  A snap runs in a sandbox which restricts which files the snap can 
> read.  Specifically, the Firefox snap can only read files in the user's home 
> directory.
>
> This would suggest that a user who builds Sage in their home directory can 
> use Firefox to view the documentation by using a URL with the file: scheme, 
> but that if Sage is installed for all users on a multi-user system or if it 
> is installed with apt then it will not be possible for users to read the 
> locally installed documentation with Firefox.  (Of course they can use 
> Firefox to read the online documentation for the current SageMath version 
> but, on Ubuntu, that is essentially guaranteed not to be the version that is 
> actually installed.)
>
> Have people run into this?

I've run into the opposite sort of situation, where Sage is run in a
container, and the browser can't get access to files there; so one
needs
to use HTTP to get across the boundary.

>
> - Marc
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/ca8f5dbe-8b50-43e1-afaa-f2073a1e70e8n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq0Xz%2B4afTcvuHsEyHg-wnb1x4vQQbHJqVb6aQGhjjzjBA%40mail.gmail.com.


Re: [sage-devel] Question about reading Sage documentation

2023-06-29 Thread William Stein
Hi,

Related Question: Is anybody interested in making it so
https://doc.sagemath.org/ hosts many different versions of the Sage
documentation instead of just the latest?

I only looked into this for a second, but readthedocs.io often has
many versions of docs for projects.   Also, I always appreciate how
postgresql's docs cover many, many versions, and make it easy to
switch around.Anyway, my point is just that "docs for multiple
versions of software" is a solved problem.

readthedocs since on their landing page: "Free docs hosting for open
source: We will host your documentation for free, forever. There are
no tricks. We help over 100,000 open source projects share their docs,
including a custom domain and theme." and then "Multiple versions: We
can host and build multiple versions of your docs so having a 1.0
version of your docs and a 2.0 version of your docs is as easy as
having a separate branch or tag in your version control system."

-- William


On Thu, Jun 29, 2023 at 3:33 PM Dima Pasechnik  wrote:
>
> On Thu, Jun 29, 2023 at 10:46 PM Marc Culler  wrote:
> >
> > During our recent release of SnapPy we ran across an issue which is likely 
> > relevant to whether Sage's documentation is viewable on newer Ubuntu 
> > systems (such as 22.04).  The issue is that these newer Ubuntu systems ship 
> > Firefox as a snap.  A snap runs in a sandbox which restricts which files 
> > the snap can read.  Specifically, the Firefox snap can only read files in 
> > the user's home directory.
> >
> > This would suggest that a user who builds Sage in their home directory can 
> > use Firefox to view the documentation by using a URL with the file: scheme, 
> > but that if Sage is installed for all users on a multi-user system or if it 
> > is installed with apt then it will not be possible for users to read the 
> > locally installed documentation with Firefox.  (Of course they can use 
> > Firefox to read the online documentation for the current SageMath version 
> > but, on Ubuntu, that is essentially guaranteed not to be the version that 
> > is actually installed.)
> >
> > Have people run into this?
>
> I've run into the opposite sort of situation, where Sage is run in a
> container, and the browser can't get access to files there; so one
> needs
> to use HTTP to get across the boundary.
>
> >
> > - Marc
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sage-devel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sage-devel+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/sage-devel/ca8f5dbe-8b50-43e1-afaa-f2073a1e70e8n%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/CAAWYfq0Xz%2B4afTcvuHsEyHg-wnb1x4vQQbHJqVb6aQGhjjzjBA%40mail.gmail.com.



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CACLE5GCF4%2BFHj0xmAqYCZ7siZCp9P%2BEQQkd%2B70Mt5xjSNqY-gA%40mail.gmail.com.


Re: [sage-devel] Re: Voting: Block-scoped optional tag and the keyword

2023-06-29 Thread Edgar Costa
I vote for (A)

On Thu, Jun 29, 2023 at 6:27 PM Marc Culler  wrote:

> I vote for (C).
>
> On Wednesday, June 28, 2023 at 9:40:07 PM UTC-5 Kwankyu Lee wrote:
>
>> Hi,
>>
>> We spent six days for the preliminary discussion in the sage-devel thread
>>
>> https://groups.google.com/g/sage-devel/c/OUnoroIf0qc
>>
>> about choosing the keyword triggering block-scoped optional tag needed in
>>
>> https://github.com/sagemath/sage/issues/35750
>>
>> We now start the voting with the four candidates (A), (B), (C), (D). The
>> voting will end 7th July 23:59 KST (Korea Standard Time). During the
>> voting, discussions can continue in the linked places but please only your
>> vote (and, if you will, short comment) to this thread.
>>
>> (A) "needs"
>>
>> sage: # needs sage.rings.number_field
>> sage: QQbar(I)^2
>> -1
>> sage: QQbar(I)^10 # long time
>> 1
>>
>> sage: # needs sage.rings.finite_rings
>> sage: F = GF(7)
>> sage: F(1) + QQbar(1)  # needs sage.rings.number_field
>> ...
>>
>> (B) "requires"
>>
>> sage: # requires sage.rings.number_field
>> sage: QQbar(I)^2
>> -1
>> sage: QQbar(I)^10  # long time
>> 1
>>
>> sage: # requires sage.rings.finite_rings
>> sage: F = GF(7)
>> sage: F(1) + QQbar(1)  # requires sage.rings.number_field
>> ...
>>
>> (C) "uses"
>>
>> sage: # uses sage.rings.number_field
>> sage: QQbar(I)^2
>> -1
>> sage: QQbar(I)^10  # long time
>> 1
>>
>> sage: # uses sage.rings.finite_rings
>> sage: F = GF(7)
>> sage: F(1) + QQbar(1)  # uses sage.rings.number_field
>> ...
>>
>> (D) "standard"
>>
>> sage: # use standard feature - sage.rings.number_field
>> sage: QQbar(I)^2
>> -1
>> sage: QQbar(I)^10  # long time
>> 1
>>
>> sage: # use standard feature - sage.rings.finite_rings
>> sage: F = GF(7)
>> sage: F(1) + QQbar(1)  # standard - sage.rings.number_field
>> ...
>>
>> Please just focus on the keyword. Don't worry about minor details or
>> punctuations: the keyword would be recognized, the rest would be ignored
>> noise, in the implementation.
>>
>> Thanks for your attention. Happy voting :-)
>>
>>
>>
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/6d732a20-6a69-46b7-ac32-063b8170a8efn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CA%2BiQ7x7LiX_NtVMV06g5FPaDmAR9ZF2Wq_Z7bw52%3DJTQke4uug%40mail.gmail.com.


Re: [sage-devel] Graphics files in Sage documentation

2023-06-29 Thread Michael Orlitzky
On 2023-06-29 23:30:57, Dima Pasechnik wrote:
> On Thu, Jun 29, 2023 at 3:24 AM Michael Orlitzky  wrote:
> >
> > On 2023-06-28 23:27:22, Dima Pasechnik wrote:
> > > One can always start a web server on localhost, instead of using file:/// 
> > > :P
> > >
> >
> > I know you're mostly joking, but that's not as easy as it sounds.
> 
> no, why? If you run ./sage -n you'll see something like
> 

Oh, sorry then. You could probably guess that if I run sage -n,
nothing happens, because I don't have the notebook installed. First
I'd have to re./configure sage and pull down a few hundred megabytes
of random crap from pypi.

Once you have all that installed, Jupyter uses a custom web server
with token-based authentication to solve the permission problem. But
in trade,

  * Every user needs to run his own server;

  * You've upped the ante from "read my files" to "execute
arbitrary code" if there's a bug in Jupyter.

Given all that I'd still say it's more complicated than "just launch a
local web server" makes it sound.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/ZJ4MPqCbuxDFe52r%40stitch.


Re: [sage-devel] Question about reading Sage documentation

2023-06-29 Thread Michael Orlitzky
On 2023-06-29 14:46:00, Marc Culler wrote:
> During our recent release of SnapPy we ran across an issue which is likely 
> relevant to whether Sage's documentation is viewable on newer Ubuntu 
> systems (such as 22.04).  The issue is that these newer Ubuntu systems ship 
> Firefox as a snap.  A snap runs in a sandbox which restricts which files 
> the snap can read.  Specifically, the Firefox snap can only read files in 
> the user's home directory.
>
> ...
> 
> Have people run into this?
> 

Alternate headline: multi-millionaire does stupid thing with
billionaire's product; how can math teachers fix it for free?

This is a combination of two problems,

  1. Mozilla has been going out of their way for a long time to make
 traditional firefox/thunderbird packages hard to maintain.

  2. Snaps are stupid (but low effort).

Despite a long-standing and fully independent hatred of Snaps, I can't
really blame Ubuntu for saying fuck it and taking the easy way out;
the firefox experience was going to be degraded in one way or another.

There aren't any great solutions because the only other mainstream
browser is managed by a spyware company and is also increasingly
difficult to package (for slightly different reasons). For second-tier
browsers, there's Falkon (Qt) and Epiphany (Gtk), which can still be
sanely packaged, but that are also missing features that most users
won't give up. Everything else is basically a Chrome theme these days
and inherits Chrome problems.

To summarize where I'm at personally,

  * Man/info pages are the standard and still work great
  * A fallback browser is nice to have around
  * There's always LaTeX/PDF
  * Not everything can be my problem

This is more of an answer to "have people run into this?" than an
actual answer, but there it is.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/ZJ4YTZcllgov1v6m%40stitch.


Re: [sage-devel] Question about reading Sage documentation

2023-06-29 Thread Marc Culler
I was asking a very specific question about SageMath on Ubuntu 22.04: Are
Ubuntu 22.04 users who install the sagemath-doc package able to read those
(Sage 9.5) docs with Firefox?

https://askubuntu.com/questions/1441339/how-can-i-use-file-urls-from-my-firefox-snap-version
suggests the answer is no, or not easily.

I thought that topic might be pertinent here.

- Marc

On Thu, Jun 29, 2023 at 6:48 PM Michael Orlitzky 
wrote:

> On 2023-06-29 14:46:00, Marc Culler wrote:
> > During our recent release of SnapPy we ran across an issue which is
> likely
> > relevant to whether Sage's documentation is viewable on newer Ubuntu
> > systems (such as 22.04).  The issue is that these newer Ubuntu systems
> ship
> > Firefox as a snap.  A snap runs in a sandbox which restricts which files
> > the snap can read.  Specifically, the Firefox snap can only read files
> in
> > the user's home directory.
> >
> > ...
> >
> > Have people run into this?
> >
>
> Alternate headline: multi-millionaire does stupid thing with
> billionaire's product; how can math teachers fix it for free?
>
> This is a combination of two problems,
>
>   1. Mozilla has been going out of their way for a long time to make
>  traditional firefox/thunderbird packages hard to maintain.
>
>   2. Snaps are stupid (but low effort).
>
> Despite a long-standing and fully independent hatred of Snaps, I can't
> really blame Ubuntu for saying fuck it and taking the easy way out;
> the firefox experience was going to be degraded in one way or another.
>
> There aren't any great solutions because the only other mainstream
> browser is managed by a spyware company and is also increasingly
> difficult to package (for slightly different reasons). For second-tier
> browsers, there's Falkon (Qt) and Epiphany (Gtk), which can still be
> sanely packaged, but that are also missing features that most users
> won't give up. Everything else is basically a Chrome theme these days
> and inherits Chrome problems.
>
> To summarize where I'm at personally,
>
>   * Man/info pages are the standard and still work great
>   * A fallback browser is nice to have around
>   * There's always LaTeX/PDF
>   * Not everything can be my problem
>
> This is more of an answer to "have people run into this?" than an
> actual answer, but there it is.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-devel" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-devel/01jkwYwRU_M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/ZJ4YTZcllgov1v6m%40stitch.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CALcZXRFQfr0zRc45a5xM7R819G7Dx_yY%2B2f3xxUz7c5rWttLBA%40mail.gmail.com.


Re: [sage-devel] Question about reading Sage documentation

2023-06-29 Thread Nathan Dunfield
On Thursday, June 29, 2023 at 8:50:27 PM UTC-5 Marc Culler wrote:

I was asking a very specific question about SageMath on Ubuntu 22.04: Are 
Ubuntu 22.04 users who install the sagemath-doc package able to read those 
(Sage 9.5) docs with Firefox?


I tested this and the answer thankfully is yes.  The sagemath-doc packages 
installs the docs into /usr/share/doc which is one place that Firefox has 
access to, I believe 
via: https://snapcraft.io/docs/the-system-package-doc-interface

Best,

Nathan

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5cecaedd-8595-4c5d-a894-398d0f0c07dfn%40googlegroups.com.