Skip to content

Order refactor #168

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

Merged
merged 22 commits into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor order in file_settings
  • Loading branch information
Joseph Damiba committed Nov 4, 2019
commit d7f588515534e0405ce5d555b8619a1e27e07797
66 changes: 60 additions & 6 deletions order.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,69 @@
from pathlib import Path, PosixPath
import sys

allPosts = [];
# the goal of this program is to take the current order and remap it to be continuous integers

# will contain all posts with display_as: file_settings
fileSettings = []
basic = []
statistical = []
scientific = []
financial = []
maps = []
threedee = []
subplots = []


#get all posts with frontmatter in md format
for md_path in Path("python").glob("**/*.md"):
post = frontmatter.load(str(md_path))
if len(post.metadata.keys()) > 0:
allPosts.append(post);
if "display_as" in post.metadata['jupyter']['plotly']:
if post.metadata['jupyter']['plotly']['display_as'] == 'file_settings':
fileSettings.append(post);
if post.metadata['jupyter']['plotly']['display_as'] == 'basic':
basic.append(post);
if post.metadata['jupyter']['plotly']['display_as'] == 'statistical':
statistical.append(post);
if post.metadata['jupyter']['plotly']['display_as'] == 'scientific':
scientific.append(post);
if post.metadata['jupyter']['plotly']['display_as'] == 'financial':
financial.append(post);
if post.metadata['jupyter']['plotly']['display_as'] == 'maps':
maps.append(post);
if post.metadata['jupyter']['plotly']['display_as'] == '3d_charts':
threedee.append(post);
if post.metadata['jupyter']['plotly']['display_as'] == 'subplots':
subplots.append(post);

for post in fileSettings:
print(post.metadata['jupyter']['plotly']['order'])
print('888888888888888888888888888888888')

for post in basic:
print(post.metadata['jupyter']['plotly']['order'])
print('888888888888888888888888888888888')

for post in statistical:
print(post.metadata['jupyter']['plotly']['order'])
print('888888888888888888888888888888888')

for post in scientific:
print(post.metadata['jupyter']['plotly']['order'])
print('888888888888888888888888888888888')

for post in financial:
print(post.metadata['jupyter']['plotly']['order'])
print('888888888888888888888888888888888')

for post in maps:
print(post.metadata['jupyter']['plotly']['order'])
print('888888888888888888888888888888888')

for post in threedee:
print(post.metadata['jupyter']['plotly']['order'])

print('888888888888888888888888888888888')

for post in allPosts:
meta = post.metadata
if "display_as" not in meta['jupyter']['plotly']:
print(meta['jupyter']['plotly']['name'])
for post in subplots:
print(post.metadata['jupyter']['plotly']['order'])
2 changes: 1 addition & 1 deletion python/colorscales.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Colorscales
order: 22
order: 19
permalink: python/colorscales/
thumbnail: thumbnail/heatmap_colorscale.jpg
redirect_from: python/logarithmic-color-scale/
Expand Down
2 changes: 1 addition & 1 deletion python/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Configuration
order: 7
order: 9
page_type: u-guide
permalink: python/configuration-options/
thumbnail: thumbnail/modebar-icons.png
Expand Down
1 change: 1 addition & 0 deletions python/creating-and-updating-figures.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jupyter:
- python/user-g/
thumbnail: thumbnail/creating-and-updating-figures.png
v4upgrade: true
order: 2
---

### Representing Figures
Expand Down
2 changes: 1 addition & 1 deletion python/hover-text-and-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jupyter:
language: python
layout: base
name: Hover Text and Formatting
order: 30.5
order: 21
permalink: python/hover-text-and-formatting/
thumbnail: thumbnail/hover-text.png
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion python/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jupyter:
language: python
layout: base
name: Images
order: 31
order: 22
permalink: python/images/
thumbnail: thumbnail/images.png
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion python/ipython-vs-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jupyter:
language: python
layout: base
name: IPython vs Python
order: 41
order: 24
permalink: python/ipython-vs-python/
thumbnail: thumbnail/venn.jpg
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion python/marker-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jupyter:
language: python
layout: base
name: Styling Markers
order: 21
order: 18
permalink: python/marker-style/
thumbnail: thumbnail/marker-style.gif
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion python/orca-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Orca Management
order: 1.5
order: 7
permalink: python/orca-management/
thumbnail: thumbnail/orca-management.png
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion python/plotly-express.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Plotly Express
order: 1
order: 4
page_type: example_index
permalink: python/plotly-express/
thumbnail: thumbnail/plotly-express.png
Expand Down
1 change: 1 addition & 0 deletions python/renderers.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jupyter:
permalink: python/renderers/
redirect_from: python/offline/
thumbnail: thumbnail/displaying-figures.png
order: 1
---

### Displaying plotly figures
Expand Down
2 changes: 1 addition & 1 deletion python/setting-graph-size.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jupyter:
language: python
layout: base
name: Setting Graph Size
order: 2
order: 8
permalink: python/setting-graph-size/
thumbnail: thumbnail/sizing.png
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion python/shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Shapes
order: 32
order: 23
permalink: python/shapes/
thumbnail: thumbnail/shape.jpg
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion python/static-image-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jupyter:
language: python
layout: base
name: Static Image Export
order: 1
order: 6
page_type: u-guide
permalink: python/static-image-export/
thumbnail: thumbnail/static-image-export.png
Expand Down
1 change: 1 addition & 0 deletions python/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jupyter:
layout: base
permalink: python/templates/
thumbnail: thumbnail/theming-and-templates.png
order: 5
---

### Theming and templates
Expand Down
2 changes: 1 addition & 1 deletion python/text-and-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jupyter:
language: python
layout: base
name: Text and Annotations
order: 30
order: 20
permalink: python/text-and-annotations/
thumbnail: thumbnail/text-and-annotations.png
v4upgrade: true
Expand Down
2 changes: 1 addition & 1 deletion python/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jupyter:
language: python
layout: base
name: Troubleshooting
order: 50
order: 25
page_type: u-guide
permalink: python/troubleshooting/
thumbnail: thumbnail/modebar-icons.png
Expand Down
2 changes: 1 addition & 1 deletion python/v4-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Version 4 Migration Guide
order: 1
order: 3
page_type: example_index
permalink: python/v4-migration/
thumbnail: thumbnail/v4-migration.png
Expand Down