Skip to content

Enh/static options - #116

Merged
jamesgao merged 3 commits into
gallantlab:masterfrom
infocortex:enh/static_options
Dec 1, 2014
Merged

Enh/static options#116
jamesgao merged 3 commits into
gallantlab:masterfrom
infocortex:enh/static_options

Conversation

@infocortex

Copy link
Copy Markdown
Contributor

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

@infocortex

Copy link
Copy Markdown
Contributor Author

Hi, here's the diff without the whitespace changes, for clarity:
https://github.com/gallantlab/pycortex/pull/116/files?w=1

(append ?w=1 to any diff view)

jamesgao added a commit that referenced this pull request Dec 1, 2014
@jamesgao
jamesgao merged commit 4bedcbc into gallantlab:master Dec 1, 2014
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.

2 participants