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

Reimplement /archive #64

Merged
merged 20 commits into from
Feb 27, 2019
Merged

Reimplement /archive #64

merged 20 commits into from
Feb 27, 2019

Conversation

bdc34
Copy link
Contributor

@bdc34 bdc34 commented Feb 13, 2019

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

@bdc34 bdc34 requested review from bbarker and mhl10 February 13, 2019 20:25
@bdc34
Copy link
Contributor Author

bdc34 commented Feb 13, 2019

Note: there is a failing test that is also failing on develop. I'm currently ignoring that as it goes by in the test results but we could wait until it is fixed in develop.
This test is fixed now.

Copy link
Contributor

@mhl10 mhl10 left a 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.

@bdc34
Copy link
Contributor Author

bdc34 commented Feb 26, 2019

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:
Catch up controller.
Year controller.
Find controller.

Copy link
Contributor

@bbarker bbarker left a 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")
]
Copy link
Contributor

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 ids). 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

Copy link
Contributor Author

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.

browse/controllers/archive_page/__init__.py Show resolved Hide resolved
@bdc34
Copy link
Contributor Author

bdc34 commented Feb 27, 2019

@bbarker

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.

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.

@bdc34 bdc34 merged commit d925c3a into develop Feb 27, 2019
@bdc34 bdc34 deleted the ARXIVNG-1294 branch February 27, 2019 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants