-
Notifications
You must be signed in to change notification settings - Fork 7
Integrate auto-generating filter list & curves, statically in docs #23
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
Open
jaladh-singhal
wants to merge
7
commits into
starkit:master
Choose a base branch
from
jaladh-singhal:intg-filt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+467
−4
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7564979
Added/updated files to generate filters list on docs
jaladh-singhal 7f034e1
Embedded notebook that allows arbitrary selection of facility & instr
jaladh-singhal 23df55e
Updated toc tree for new files added
jaladh-singhal 1fde9c3
Removed not-needed python 2.7 build-docs job from travis
jaladh-singhal f7f8d9c
Some PEP8 naming changes
jaladh-singhal 1a76fc2
Added filter tables in facility pages
jaladh-singhal 1396598
Looped filter info, included string formatting
jaladh-singhal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ MANIFEST | |
| # Sphinx | ||
| docs/api | ||
| docs/_build | ||
| docs/_facility_pages | ||
|
|
||
| # Eclipse editor project files | ||
| .project | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| Filters of Observation Facility: {{ facility }} | ||
| ==================================================== | ||
|
|
||
| {% set facility_data=data[data['Obs. Facility']==facility] %} | ||
| {% set inst_list=facility_data['Instrument'].unique().tolist() %} | ||
| {% for inst in inst_list %} | ||
|
|
||
| {% if inst!='NA' %} | ||
| {% if loop.first %} | ||
| Following **Instruments** are present: | ||
|
|
||
| {% endif %} | ||
|
|
||
| {{ inst }} | ||
| -------------------------- | ||
|
|
||
| {% endif %} | ||
|
|
||
| {% set inst_data=facility_data[facility_data['Instrument']==inst] %} | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
|
|
||
| * - {{ inst_data.index.name }} | ||
| {% for col_name in inst_data.columns.values %} | ||
| - {{ col_name }} | ||
| {% endfor %} | ||
|
|
||
| {% for filter_info in inst_data.itertuples() %} | ||
| {% for info in filter_info %} | ||
| {% if loop.first %} | ||
| * - {{ info }} | ||
| {% elif loop.last %} | ||
| - {{ info|replace('_ ','\_ ') }} | ||
| {% else %} | ||
| - {{ info }} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% endfor %} | ||
|
|
||
|
|
||
| <Plots> | ||
|
|
||
| {% endfor %} |
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
Oops, something went wrong.
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.
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.
is that really necesary?
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.
Yes it is absolutely necessary. See, we're building a static documentation of a very large dataset (~4500 filters) so we need to distribute that data across different pages - for which we're putting them hierarchically as per the facilities they belong to. Since we need ~78 facility HTML pages, thus we have to provide Sphinx ~78 RST pages from which it can build HTML by rendering them differently using Jinja Template variables.
This is achieved by a single template file
facility_page.rstas I explained in 1st comment. Think of_facilty_pagesdir hence created, equivalent to_builddir which are solely generated & controlled by Sphinx while building docs, without requiring any user intervention. The only difference is_facilty_pagesdir is created as a part of pre-build step immediately after command to build docs is given, and_builddir when rst is read & rendered. So they are more or less same which make sure that docs can be build, while at the same time they doesn't affect our repo (gitignored).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.
I understand this - I mean can you create them in the right directory
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.
What do you think is right directory?
We can't put them in
_buildor_templatedir, Sphinx doesn't read files from them. We can't put them in_staticdir i.e. meant for custom stylesheets and other static files (like images, etc.), not at all for storing .rst files. I've accounted all options then used it and it gives desired results.Sphinx docs even say that, "Sphinx is highly customizable but that means all you can do with them is not documented". I understand what I've done, is quite new to grasp, but consider it as a customized way to achieve what we want to implement.
I might be missing something, could you please elaborate what wrong do you see in it?
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.
it's not very new to grasp 😉 - you somehow create the files earlier and then move them - why not create them directly where they should live.