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

remove (or clean up) SAGE_ROOT/examples #7494

Closed
williamstein opened this issue Nov 19, 2009 · 37 comments
Closed

remove (or clean up) SAGE_ROOT/examples #7494

williamstein opened this issue Nov 19, 2009 · 37 comments

Comments

@williamstein
Copy link
Contributor

Did you know there is a directory SAGE_ROOT/examples? Do you care? Because if nobody seriously cares, I'm going to delete it from future versions of Sage, since it is still a mess, and the last nontrivial commit was 1.5 years ago (!):

changeset:   158:d18dad210d3b
user:        Mike Hansen <mhansen@gmail.com>
date:        Mon Apr 14 03:08:48 2008 -0700
summary:     Extract sagetex.py and sagetex.sty

I can put the same directory online somewhere, and move the fortran file that is used in one doctest out. I'm just really curious if anybody knows about this directory and cares.

Apply:

  1. attachment: trac_7494.patch to the Sage library repo
  2. attachment: trac_7494-ref.patch to the Sage library repo
  3. attachment: trac_7494-scripts.patch to the scripts repo
  4. attachment: trac_7494-root-repo.patch to the Sage root repository

Release Manager:

Delete $SAGE_ROOT/examples/ as part of this ticket.

(This should happen automatically, i.e., the directory should vanish, when sdisting.)

CC: @wdjoyner

Component: misc

Keywords: sd32

Author: William Stein, John Palmieri

Reviewer: Karl-Dieter Crisman, Rob Beezer, Leif Leonhardy

Merged: sage-4.7.2.alpha4

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

@williamstein
Copy link
Contributor Author

comment:1

#298 would be invalidated by doing this ticket.

@kcrisman
Copy link
Member

comment:2

I was wondering about that directory too a few months ago. So we don't do anything with it currently? Here are comments.

I think it would be worth linking at least a few of the top-level ones to the wiki, and perhaps put in one of the documentation places, as some of the examples files there are definitely useful for templates.

I bet some of the programming (Pyrex/SageX/Cython) examples might be useful too.

I am cc:ing wdj to see if he thinks all his examples/routines from calculus are now in the main Sage library.

The linalg folder is definitely pointless, as permanents are now in the main library.

The worksheets folder seems pretty pointless in its current state.

The tests directory has some things that should be added as random doctests for those things, though.

The modsym directory stuff likely is already tested in that area, given how important it is to Sage!

The latex_embed is obviously superfluous at this point.

Fortran was has already discussed above.

Finance is really pointless.

The Groebner basis thing seems intriguing - perhaps should be incorporated in doctests for that elsewhere?

Is the Ajax thing now very very superfluous, given how much we use it? It's not (that) old.

The GSL folder is quite large compared to the rest and perhaps has some examples which should be combined into one big file which is doctested, if those sorts of tests aren't. It would seem valuable not to lose this many doctests -does it currently pass?

@kcrisman
Copy link
Member

comment:3

I am cc:ing wdj to see if he thinks all his examples/routines from calculus are now in the main Sage library.

See #7936 for this - we can delete this one, at least.

@kini
Copy link
Contributor

kini commented Jun 14, 2011

comment:4

The last nontrivial commit was 1.5 years before this ticket was created, but now it's been 1.5 years since this ticket was created! Can we get rid of this directory yet?

@kcrisman
Copy link
Member

comment:5

I have asked about this a lot. In order to give this, it would be really nice to move a few of the examples to other places - wiki, wherever.

  • a few top-level things
  • some of the Cython ones?
  • tests has a few interesting random doctests
  • something fortran is needed somewhere, apparently? According to the comment in was' original report
  • The GSL examples might be worth moing somewhere
  • Groebner useful in doctests?

Anyway, we shouldn't just completely delete in case there are useful tests. But I totally agree on the overall strategy.

@williamstein
Copy link
Contributor Author

comment:6

Delete it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I wrote almost everything in there, and it should just go.

I give "delete the examples directory" a positive review. To merge this ticket, do

cd SAGE_ROOT
rm -rf examples

@williamstein
Copy link
Contributor Author

comment:8

For future reference, I've put that directory here:

http://wstein.org/old_sage_examples/

@williamstein
Copy link
Contributor Author

comment:9

I just realized that there is one thing that has to be done. Observe:

wstein@ubuntu:~/d/sage$ sage -grep "examples"|grep SAGE_ROOT
finance/stock.py:            sage: finance.Stock('aapl').load_from_file(SAGE_ROOT + '/examples/finance/AAPL-minutely.csv')[:5]
finance/stock.py:            sage: finance.Stock('goog').load_from_file(SAGE_ROOT + '/examples/finance/AAPL-minutely.csv')[:5]
finance/stock.py:            sage: finance.Stock('aapl').load_from_file(SAGE_ROOT + "/examples/finance/AAPL-minutely.csv")
misc/hg.py:hg_examples = HG('%s/data/examples'%SAGE_ROOT,
misc/inline_fortran.py:            sage: s = open(os.environ['SAGE_ROOT'] + '/examples/fortran/FIB1.F').read()
wstein@ubuntu:~/d/sage$ 

So the stuff in examples that are used in doctests need to be moved to the SAGE_ROOT/data/ directory. Thus one needs to attach a patch that does this to this ticket, and that patch will need to be reviewed.

@williamstein
Copy link
Contributor Author

Attachment: trac_7494.patch.gz

@williamstein
Copy link
Contributor Author

comment:10

The patch trac_7494.patch should change the core sage library so it doesn't depend on anything in the SAGE_ROOT/examples directory for testing. It also does not put anything in the SAGE_ROOT/data directory, since that is not needed.

@kcrisman
Copy link
Member

comment:12

So the Groebner, gsl, etc. tests aren't really useful? Ok by me.

Nice - thanks for looking at this "officially". Since there is a Sage Days going on and today is my first day of classes, I think someone will beat me to the review, but thanks for looking at this a bit more carefully. In some sense, you are the only person who can check it, since you're one of the few who really knows why these things were in in the first place :)

@kcrisman
Copy link
Member

Author: William Stein

@williamstein
Copy link
Contributor Author

Changed keywords from none to sd32

@rbeezer

This comment has been minimized.

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Aug 25, 2011

Reviewer: Karl-Dieter Crisman, Rob Beezer

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Aug 25, 2011

comment:14

Trash it. There's too much old misleading stuff about as is.

I renamed the examples directory, applied the patch, ran tests and got no failures.

I guess we need to alert the release manager somehow to actually delete the directory in the next distribution? I'll put a note above, edit as necessary.

@jhpalmieri
Copy link
Member

Changed author from William Stein to William Stein, John Palmieri

@jhpalmieri

This comment has been minimized.

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member

Changed work issues from Add a patch for the root repo. to none

@jhpalmieri
Copy link
Member

comment:19

I think this searches through all of the relevant files:

$ grep -win examples `hg manifest`

I'm attaching a patch for this. In addition to the two files you found, it also patches libdist_filelist, which looks like it is completely out of date, but it doesn't hurt to patch it anyway.

@jhpalmieri
Copy link
Member

root repo

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 29, 2011

Changed reviewer from Karl-Dieter Crisman, Rob Beezer to Karl-Dieter Crisman, Rob Beezer, Leif Leonhardy

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 29, 2011

comment:20

Attachment: trac_7494-root-repo.patch.gz

Ok, I've sdisted with a version with the patches applied, built the new Sage distribution from scratch, and all (long) tests pass.

As expected, I got rid of the examples/ directory and the spkg in the new distro.
(Note that also the examples spkg in spkg/standard/ of the original distribution got deleted; not sure whether this is intentional. In contrast, the examples/ directory there remained.)

Upgrading from a path without an examples spkg shouldTM IMHO also work; haven't tried that [yet].

Don't know yet whether Jeroen's merger is "prepared" for such an operation, and since Sage 4.7.2.alpha3 is almost out, I don't think I'll attempt to merge this ticket into this release. There'll certainly be an alpha4, or we could try with the next release candidate.

Unfortunately we don't win much regarding the size; the current examples spkg is just 2.0 MB, 3.9 MB uncompressed on my disk (i.e., the size of the examples/ directory), and just 2.6 MB in "real" bytes.

@jdemeyer
Copy link

jdemeyer commented Oct 4, 2011

comment:21

Problems while building the documentation:

dochtml.log:/mnt/usb1/scratch/jdemeyer/merger/sage-4.7.2.alpha4/local/lib/python2.6/site-packages/sage/finance/stock.py:docstring of sage.finance.stock.OHLC:3: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
dochtml.log:/mnt/usb1/scratch/jdemeyer/merger/sage-4.7.2.alpha4/local/lib/python2.6/site-packages/sage/finance/stock.py:docstring of sage.finance.stock.OHLC:8: (ERROR/3) Unexpected indentation.

@jhpalmieri
Copy link
Member

comment:22

I believe this referee patch should fix the documentation problem.

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member

Attachment: trac_7494-ref.patch.gz

Sage library: fix docbuilding problem

@nexttime
Copy link
Mannequin

nexttime mannequin commented Oct 5, 2011

comment:23

Replying to @jhpalmieri:

I believe this referee patch should fix the documentation problem.

Belief is not a technical category.

Nice patch by the way.

@jdemeyer
Copy link

jdemeyer commented Oct 5, 2011

Merged: sage-4.7.2.alpha4

@jhpalmieri
Copy link
Member

comment:25

See #11907 for a followup.

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