Opened 2 years ago
Closed 2 years ago
#30452 closed enhancement (fixed)
"sage startuptime" should accept file names too
Reported by:  Matthias Köppe  Owned by:  

Priority:  major  Milestone:  sage9.2 
Component:  doctest framework  Keywords:  
Cc:  Dima Pasechnik, Tobias Diez, Frédéric Chapoton, John Palmieri, Travis Scrimshaw, Volker Braun  Merged in:  
Authors:  Matthias Koeppe  Reviewers:  John Palmieri 
Report Upstream:  N/A  Work issues:  
Branch:  306c390 (Commits, GitHub, GitLab)  Commit:  306c390c8dedc5763fde5b94fa4f8e915e27ba46 
Dependencies:  Stopgaps: 
Description (last modified by )
Change History (15)
comment:1 Changed 2 years ago by
Branch:  → u/mkoeppe/_sage__startuptime__should_accept_file_names_too 

comment:2 Changed 2 years ago by
Authors:  → Matthias Koeppe 

Commit:  → 06c4b55d488d11399a83143b7942aa56e796884b 
Description:  modified (diff) 
Status:  new → needs_review 
comment:3 Changed 2 years ago by
Cc:  Travis Scrimshaw added 

comment:4 Changed 2 years ago by
Cc:  Volker Braun added 

Description:  modified (diff) 
comment:5 Changed 2 years ago by
It's certainly true that ./sage startuptime src/sage/homology/simplicial_set.py
raises an error without this branch and doesn't raise an error with it, but with this branch it produces no output. What is it supposed to do?
By the way, it makes me a little uncomfortable to use the same loop variable twice like this:
for module_arg in cmdline_args: ... for module_arg in matching_modules: ...
comment:6 Changed 2 years ago by
On the other hand, ./sage startuptime src/sage/geometry/polyhedron/base.py
does produce output. I'm confused.
comment:7 Changed 2 years ago by
I would also recommend an explicit import os
statement. I'm not sure why the script works without it. Edit: I guess it's being imported from sage.all
, but it would be better to make it explicit at the top.
comment:8 Changed 2 years ago by
Without this ticket ./sage startuptime sage.homology.simplicial_set
gives
[] Traceback (most recent call last): File "/Users/mkoeppe/s/sage/sagerebasing/worktreealgebraic2018spring/src/bin/sagestartuptime.py", line 148, in <module> raise ValueError('"' + module_arg + '" does not uniquely determine Sage module.') ValueError: "sage.homology.simplicial_set" does not uniquely determine Sage module.
Before working on this ticket, I had never used these scripts. I don't really know whether the above is expected, or a result of undetected bitrot over the years.
I think that it only works for modules that are loaded when sage.all
is loaded.
comment:9 Changed 2 years ago by
Is it worth printing a message if the file or module is not loaded when sage.all
is loaded, rather than being completely silent?
comment:10 Changed 2 years ago by
Commit:  06c4b55d488d11399a83143b7942aa56e796884b → 4256c9f28934368161c672162c397cd34dbcbd93 

comment:11 Changed 2 years ago by
Commit:  4256c9f28934368161c672162c397cd34dbcbd93 → 306c390c8dedc5763fde5b94fa4f8e915e27ba46 

Branch pushed to git repo; I updated commit sha1. New commits:
306c390  src/bin/sagestartuptime.py: Use different variable in nested loop

comment:13 Changed 2 years ago by
Reviewers:  → John Palmieri 

Status:  needs_review → positive_review 
Great, thank you for the changes.
comment:15 Changed 2 years ago by
Branch:  u/mkoeppe/_sage__startuptime__should_accept_file_names_too → 306c390c8dedc5763fde5b94fa4f8e915e27ba46 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
src/bin/sagestartuptime.py: Accept file/directory names too