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
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch of the current git/mercurial repository | |
# * the return value of the previous command | |
# * the fact you just came from Windows and are used to having newlines in | |
# your prompts. |
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
"""Module to plot Gravitational Wave Templates | |
Can be used to test if a waveform approximant works or not. | |
""" | |
from __future__ import division, print_function | |
import bilby | |
import matplotlib.pyplot as plt |
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
from stack import Stack | |
def lecuture_test_1(): | |
out_string = "" | |
int_stack = Stack() | |
int_stack.push(1) | |
int_stack.push(2) | |
out_string += f"{int_stack.pop()} , " | |
int_stack.push(3) |
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
""" | |
Match the error with the function | |
a. TypeError | |
b. AttributeError | |
c. IndexError | |
d. ValueError (error 1) | |
e. ZeroDivisionError | |
f. IndentationError | |
More error types: |
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 matplotlib.pyplot as plt | |
import numpy as np | |
from mpl_toolkits import mplot3d | |
# Defining the functions and its first derivative | |
def f(x): | |
return x ** 3 - 2 * x ** 2 - 11 * x + 12 | |
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
""" | |
Completed backtracking code for week11, demonstrating bike-lock combos | |
Author: Gavin | |
Modifed by: Avi | |
""" | |
import itertools | |
from typing import List |
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
from typing import List, Optional | |
import seaborn as sns | |
def get_colors(num_colors: int, alpha: Optional[float]=1) -> List[List[float]]: | |
"""Get a list of colorblind colors, | |
:param num_colors: Number of colors. | |
:param alpha: The transparency | |
:return: List of colors. Each color is a list of [r, g, b, alpha]. | |
""" |
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
"""Demo of Matched Filtering""" | |
from typing import Callable, Dict, Optional | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import plotly.graph_objects as go | |
import scipy.signal | |
from plotly.subplots import make_subplots | |
N_POINTS = 1000 |
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
### FIGURE | |
figure.facecolor: white | |
figure.dpi: 300 | |
figure.titlesize: x-large # fontsize of the axes title | |
figure.titleweight: bold | |
### LINES | |
lines.linewidth: 1.5 | |
### PATCHES |
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
#%% md | |
# Plot signal | |
#%% | |
import bilby | |
import matplotlib.pyplot as plt | |
import numpy as np |
OlderNewer