This file contains 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
def break_spines(ax,spines,symbol=u'\u2571',**kwargs): | |
"""Simulates broken axes using subplots. Need to fix heights according to given data for real aspect. Also plot the same data on each axes and set axes limits. | |
- **Parameters** | |
- ax : Axes who's spine(s) to edit. | |
- spines: str,list, str/list of any of ['top','bottom','left','right']. | |
- symbol: Defult is u'\u2571'. Its at 60 degrees. so you can apply rotation to make it any angle. | |
kwargs are passed to plt.text. | |
""" | |
kwargs.update(transform=ax.transAxes, ha='center',va = 'center') | |
_spines = [spines] if isinstance(spines,str) else spines |
This file contains 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 gist is developed as separate package. Do pip install ipyslides or go to https://github.com/massgh/ipyslides |
This file contains 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
""" | |
Python is a dynamic language, and it is relatively easy to dynamically create | |
and modify things such as classes and objects. Functions, however, are quite | |
challenging to create dynamically. | |
One area where we might want to do this is in an RPC library, where a function | |
defined on a server needs to be available remotely on a client. | |
The naive solution is to simply pass arguments to a generic function that | |
accepts `*args` and `**kwargs`. A lot of information is lost with this approach, | |
however, in particular the number of arguments taken. Used in an RPC | |
implementation, this also delays any error feedback until after the arguments |
This file contains 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
import numpy as np | |
import PIL | |
from io import BytesIO | |
import matplotlib.pyplot as plt | |
def plt_to_text(plt_fig=None,width=144,vscale=0.96,colorful=True,invert=False,crop=False,outfile=None): | |
"""Displays matplotlib figure in terminal as text. You should use a monospcae font like `Cascadia Code PL` to display image correctly. Use before plt.show(). | |
- **Parameters** | |
- plt_fig: Matplotlib's figure instance. Auto picks if not given. | |
- width : Character width in terminal, default is 144. Decrease font size when width increased. |
This file contains 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
import streamlit as st | |
import pivotpy as pp | |
import os | |
st.write('# Streamlit from Remote Server!') | |
path_project = st.text_input("Literal Path to project folder", os.getcwd()) | |
with st.spinner('Selecting Files ...'): | |
if os.path.isdir(path_project): | |
files = pp.get_child_items(path_project,include=['vasprun.xml'],filesOnly = True) | |
else: | |
st.warning('Path is incorrect, falling back to launch path') |
This file contains 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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, | |
and distribution as defined by Sections 1 through 9 of this document. |
This file contains 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
{ | |
"name": "Build", | |
"foreground": "#f1f1f1", | |
"background": "#492D7C", | |
"cursorColor": "#FFFFFF", | |
"black": "#0C0C0C", | |
"red": "#C50F1F", | |
"green": "#13A10E", | |
"yellow": "#C19C00", |