Skip to content

Instantly share code, notes, and snippets.

View fedebenelli's full-sized avatar
⬇️

Federico E. Benelli fedebenelli

⬇️
View GitHub Profile
@fedebenelli
fedebenelli / install.sh
Created October 24, 2022 18:42
basic pyforfluids
sudo apt install gfortran
pip install git+https://github.com/fedebenelli/PyForFluids/tree/dev matplotlib jupyter
@fedebenelli
fedebenelli / setup_wsl.sh
Last active January 30, 2024 00:02
Setup WSL for Fortran development
#!/bin/sh
install_packages() {
# First update everything.
apt update && apt upgrade
# Install:
# - Python package manager
# - GNU Fortran compiler
# - BLAS and LAPACK libraries (for linear algebra operations)
@fedebenelli
fedebenelli / com
Created March 12, 2022 23:36
Compositional data of a reservoir fluid, extracted from the Pedersen book
component,molar_percentage,molar_mass,density
N2,0.49,—,—
CO2,0.31,—,—
C1,44.01,—,—
C2,3.84,—,—
C3,1.12,—,—
iC4,0.61,—,—
nC4,0.72,—,—
iC5,0.69,—,—
nC5,0.35,—,—
@fedebenelli
fedebenelli / report_reorder.py
Last active March 30, 2020 09:29
Python3 script that iterates through all the files in a folder, then gets all the ones that have some particular format and moves them to a folder according to the values in that fomat (year in this case)
import os
import re
# Definition of a File object
class File(object):
def __init__(self, path, day, month, year):
self.name = os.path.basename(path)
self.path = path
self.date = day
self.month = month