Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dgerosa's full-sized avatar
🚀

Davide Gerosa dgerosa

🚀
View GitHub Profile
@dgerosa
dgerosa / parallel_toy.py
Created June 27, 2021 19:58
Simple parallel jobs in python
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 / writeapaper.yml
Last active May 6, 2023 11:36
Github workflow to compile and deploy latex
# Github workflow to compile latex and deploy the pdf to an orphan branch.
# The latest compiled pdf is at available at e.g.
# https://github.com/dgerosa/reponame/blob/build/filename.pdf
# Davide Gerosa (2021) https://github.com/dgerosa
name: writeapaper
on: [push]
jobs:
paper:
runs-on: ubuntu-latest
@dgerosa
dgerosa / nsphere.py
Created December 14, 2018 06:32
nsphere
'''
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