This is a file that describes how our pipeline should be working for Marick Manrho. I hope it will be useful to him.
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 | |
stty -ixon # Disable ctrl-s and ctrl-q. | |
shopt -s autocd #Allows you to cd into directory merely by typing the directory name. | |
HISTSIZE= HISTFILESIZE= # Infinite history. | |
export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" | |
[ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases | |
# System Maintainence | |
alias mw="~/.config/mutt/mutt-wizard.sh" |
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 sqlalchemy import create_engine, Column, Integer, String # , ForeignKey | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker # , relationship, backref | |
engine = create_engine('sqlite://:memory:') | |
Base = declarative_base() | |
# Table classes here | |
# example: |
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
class ClassBuilder: | |
def __init__(self): | |
self.data = {} | |
def load_source1(self, params_for_source1): | |
self.data.update(api_call_source1(params_for_source1)) | |
def load_source1(self, params_for_source2): | |
self.data.update(api_call_source1(params_for_source2)) | |
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 lark import Lark | |
grammar = r""" | |
start: _NL* _section+ | |
_section: _HEADER _content* _HEADER | |
_HEADER: "--- SECTION ---" _NL | |
_content: number_list | |
| assign | |
| _other | |
number_list: NUMBER+ _NL |
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
/export/home/ccprakt3/miniconda3/lib/python3.9/site-packages/pandas/core/frame.py:3607: SettingWithCopyWarning: | |
A value is trying to be set on a copy of a slice from a DataFrame. | |
Try using .loc[row_indexer,col_indexer] = value instead | |
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy | |
self._set_item(key, value) |
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
# Data source | |
gen = ({'a': 3, 'b': 4} for i in range(300)) | |
a = map(lambda d: d['a'], gen) | |
b = map(lambda d: d['b'], gen) |
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 outside_try(): | |
foo = None | |
try: | |
foo = load_foo() | |
except FooLoadingError: | |
return "Foo failed to load" | |
# Do all the things | |
return foo | |
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 | |
from scipy.optimize import curve_fit | |
from scipy import signal | |
def gauss(x, mu, sigma, A): | |
return A / (sigma * np.sqrt(2 * np.pi)) * np.exp(- .5 * np.power((x-mu)/sigma , 2)) | |
peakind = signal.find_peaks_cwt(inten_na2, np.arange(2,5), noise_perc=90, min_length=2, min_snr=2) | |
# plt.plot(lamb_na2, inten_na2) |
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
a = ( (1, 2), (3, 6), (4, 8) ) | |
b = ( 1, 3, 4) | |
c = a / b | |
c == ( (1, 2), (1, 2), (1, 2) ) |
NewerOlder