-
Notifications
You must be signed in to change notification settings - Fork 63
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
Reimplement /archive #64
Conversation
This adds a route and template for /archive. ARXIVNG-1294
Also fixing problem with year stats links. ARXIVNG-1294
ARXIVNG-1294
ARXIVNG-1294
Changes list blueprint to handle GET
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, with minor changes requested. You had mentioned a couple of "stray" sub-pages that we agreed shouldn't be part of this work. Do you remember what those were? Just want to record them somewhere.
Looks like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, just a few minor questions/suggestions.
The archive pages look relatively simple enough that we probably don't need to repurpose our original /abs comparison script to be run on this, but I thought I'd throw it out there as an idea. The other aspect of it would be that maybe it doesn't matter as much if everything stays (almost) the same in /archive as it does in /abs.
(id, ARCHIVES[id]["name"]) | ||
for id in ARCHIVES.keys() | ||
if id not in ARCHIVES_SUBSUMED and not id.startswith("test") | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm I know what is happening here, I think Python is flattening the elements of what is inside the [
]
to be a list. But it looks like this almost a reverse-map style of syntax, where the output is specified first ((id, ARCHIVES[id]["name"])
) then the list of things to map over is specified (the filtered id
s). Would be good to know what this is. Also, are archives
just List[str, str]
? might be nice to annotate to make it a little more clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have it. The reverse-map syntax is python list comprehension.
I often use flatten (as in flatmap) to mean [[a],[b,c]] => [a,b,c] which isn't happening here. But I think you mean flaten in a metaphorical sense.
I was thinking of doing something like that. I thought it would be useful to gather several thousands requests from the access logs and test them against NG /archive. It would also be good to test NG /list this way. I was thinking that this could happen during the testing phase of this release. |
Reproduces /archive route for browse.
To try it out:
clone the repo, check out the branch,
pipenv install
pipenv shell
FLASK_APP=app.py FLASK_DEBUG=1 pipenv run flask run
Then go to some archives
Single category archive:
http://localhost:5000/archive/hep-ph
Multi category archive:
http://localhost:5000/archive/physics
Multi category archive with descriptions:
http://localhost:5000/archive/astro-ph
Subsumed category:
http://localhost:5000/archive/acc-phys