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
wedding = Expense( | |
"Wedding", Uniform(Jan/1/2026, Oct/1/2026), Normal(3.3e4, 2e3) | |
) | |
house_dp = Expense( | |
"House downpayment", Uniform(Jan/1/2027, Jan/1/2028), Uniform(8e4, 1.2e5) | |
) | |
sim = Simulation([house_dp, wedding], start=Oct/1/2024, end=Nov/1/2094, samples=10000) | |
sim.run() |
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
from dataclasses import dataclass | |
import pylaborchestrate as plo | |
from pylabrobot.resources import ( | |
TIP_CAR_480_A00, | |
PLT_CAR_L5AC_A00, | |
Cos_96_DW_1mL, | |
HTF_L | |
) | |
from pylabrobot.resources import Deck, TipRack, Plate | |
from pylabrobot.liquid_handling import LiquidHandler |
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
url | smiles | melting_point_K | name | density_g_cm3 | dipole_moment_Debye | boiling_point_K | cas_number | |
---|---|---|---|---|---|---|---|---|
https://en.wikipedia.org/wiki/Actinium(III)_oxide | [O--].[O--].[O--].[Ac+3].[Ac+3] | 327 | Actinium(III) oxide | |||||
https://en.wikipedia.org/wiki/Silver_tetrafluoroborate | [Ag+].F[B-](F)(F)F | 71.5 | Silver tetrafluoroborate | 4.16 | ||||
https://en.wikipedia.org/wiki/Silver_bromide | [Ag]Br | 430 | Silver bromide | 6.47 | 5.62 | 502 | ||
https://en.wikipedia.org/wiki/Silver_bromate | [Ag+].[O-]Br(=O)=O | 309 | Silver bromate | 5.206 | ||||
https://en.wikipedia.org/wiki/Silver_chloride | Cl[Ag] | 455 | Silver chloride | 547 | ||||
https://en.wikipedia.org/wiki/Silver_chlorate | [Ag+].[O-]Cl(=O)=O | 230 | Silver chlorate | 4.443 | 250 | |||
https://en.wikipedia.org/wiki/Silver_perchlorate | [Ag+].[O-]Cl(=O)(=O)=O | 486 | Silver perchlorate | 2.806 | ||||
https://en.wikipedia.org/wiki/Silver_cyanide | [C-]#N.[Ag+] | 335 | Silver cyanide | 3.943 | ||||
https://en.wikipedia.org/wiki/Silver_fulminate | [C-]#[N+][O-].[Ag+] | Silver fulminate | 3.938 |
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
from typing import Dict, List, Literal | |
from scipy.stats import linregress, spearmanr | |
from sklearn import metrics | |
SCORE_NAMES = ["mae", "mse", "rmse", "mape", "r2", "maxe", "expl_var"] | |
def calculate_metrics( | |
y_true, y_pred, scores: List[str] = SCORE_NAMES | |
) -> Dict[str, float]: | |
"""Calculate metrics on a given dataset.""" |
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
import logging | |
import re | |
from typing import Tuple, Union | |
import pandas as pd | |
import requests | |
from bs4 import BeautifulSoup | |
from tqdm import tqdm | |
wikipedia_base = "https://en.wikipedia.org" |
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
import numpy as np | |
def pareto_efficient(data, maximize=True): | |
""" | |
Copied from Summit, which in turn was probably copied from Stackoverflow | |
Find the pareto-efficient points | |
Parameters | |
--------- | |
data: array-like | |
An (n_points, n_data) array |
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
from typing import Dict, List, Optional | |
import matplotlib as mpl | |
from matplotlib.axes import Axes | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def parity_plot( | |
y, | |
yhat, | |
ax: Optional[Axes] = None, |
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
import pandas as pd | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib import cm, ticker | |
from matplotlib.axes import Axes | |
from matplotlib.figure import Figure | |
from scipy.interpolate import make_interp_spline | |
from typing import Callable, Dict, List, Optional, Union |
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
from rdkit import Chem | |
"""The code below is directly copied from the thermo group_contribution code (MIT license) | |
https://github.com/CalebBell/thermo/blob/516dee4ceda8e100918c7645e393a42fdfdc4bef/thermo/group_contribution/ | |
I made changes to the SMARTS strings to match the ones used in FeOs | |
""" | |
J_BIGGS_JOBACK_SMARTS = [ | |
["Methyl", "CH3", "[CX4H3]"], | |
["Secondary acyclic", "CH2", "[!R;CX4H2]"], |
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
import numpy as np | |
x = np.arange(100) | |
N = 0 | |
mean = 0 | |
std = 0 | |
for i in range(11): | |
batch = x[10*i:10*(i+1)] | |
k = len(batch) | |
N += k | |
old_mean = mean |
NewerOlder