Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Davide Gerosa dgerosa

🚀
View GitHub Profile
@dgerosa
dgerosa / parallel_toy.py
Created Jun 27, 2021
Simple parallel jobs in python
View parallel_toy.py
import numpy as np
import multiprocessing, pathos.multiprocessing
from tqdm import tqdm
import os
#print(os.getpid())
# I want to execute a function...
def fun(a,b):
#print(os.getpid())
@dgerosa
dgerosa / compile_deploy_latex.yml
Last active Jun 20, 2021
Github workflow to compile and deploy latex
View compile_deploy_latex.yml
# Github workflow to compile latex and deploy the pdf to an orphan branch.
# Davide Gerosa (2021) https://github.com/dgerosa
# Edit the DIR and FILE variables with the location of the latex file.
# Place the yml file in a directory called .github/workflows
# The latest compiled pdf is made available at e.g.
# https://github.com/dgerosa/[repositoryname]/blob/build/[filename].pdf
# You can also add a badge to your README:
View nsphere.py
'''
Calculate the volume of the n-dimensional spehere a function of the dimension using a simple hit-or-miss Monte Carlo.
'''
from __future__ import print_function, division
import numpy as np
import scipy.special
import pylab as plt
import time