Enh/static options - #116
Merged
Merged
Conversation
…enh/static_options (seeing if merging upstream is improving 'mergabilty' score)
Contributor
Author
|
Hi, here's the diff without the whitespace changes, for clarity: (append ?w=1 to any diff view) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Guys,
In our work on generating static pycortex views into NeuroVault, we've arrived a few small changes that we think might improve the usage of pycortex when used to generate views that are served and deployed by another site or webapp.
In our usage a generic subject (fsaverage) is used in all data views, so as a result, the same CTM data in the datastore cache is copied to each static directory. As the number of data sets stored in Neurovault continues to grow, led to a considerable amount of redundant data on disk.
As a solution I've added a an optional argument to make_static() that disables of the copying of the ctm data. In that case, of course the user will have to serve these files separately with their web server, which works well for us.
The other change included in this PR addresses a similar issue. The htmlembed feature is neat, it makes nicely portable static views, but one disadvantage is that the embedding makes caching impossible, and since the views are often fairly large >10mb, this can be problematic for a web deployment of pycortex content.
To sort that out, we've also added a optional arg that tells make_static to skip the embedding, and keep the conventional urls in the html output.
The changes are pretty small in scope, default-off optional args, so I hope you'll find it a useful change for the static-generation use case of pycortex.
BTW, sorry for all the less-meaningful diff lines, my editor removes trailing whitespace, hope you don't mind.
Thanks!
Gabriel