Skip to content

Instantly share code, notes, and snippets.

@ggirelli
Last active June 27, 2023 07:33
Show Gist options
  • Save ggirelli/4f26ced5333e4082b969b56923426125 to your computer and use it in GitHub Desktop.
Save ggirelli/4f26ced5333e4082b969b56923426125 to your computer and use it in GitHub Desktop.
MyShortCV Python3 class
from typing import Dict, List, Tuple
City = str
Country = str
Institute = str
Lab = str
Language = str
LoveLevel = float
Program = str
Title = str
YearRange = Tuple[int, int]
class SketcherCV(object):
_media: List[str] = [
"Watercolors",
"Alcohol markers",
"Brush pen",
"Dip pen",
"Pencil",
]
_style: List[str] = ["digital art", "classical art"]
def __str__(self) -> str:
short_cv = f"""
In my free time, I love to sketch ({', '.join(self._style)}),
and my favorite media are: {', '.join(self._media)}.\n"""
return short_cv
class TrainingCV(object):
_training_title: str = "Biotech and Bioinformatics"
_studied_at: List[Tuple[YearRange, Program, Institute]] = [
(
(2009, 2012),
"BS in Biomolecular Science and Technology",
"University of Trento",
),
(
(2012, 2014),
"MS in Cellular and Molecular Biotechnology",
"University of Trento",
),
(
(2015, 2021),
"PhD studies",
"Karolinska Institutet / Science for Life Laboratory",
),
]
_interned_at: List[Tuple[YearRange, Lab, Institute]] = [
((2012, 2012), "Arosio lab", "Sezione di Trento, IBF / CNR"),
((2014, 2014), "Quackenbush lab", "Dana-Farber Cancer Institute, Boston"),
((2014, 2015), "Demichelis lab", "CIBIO, University of Trento"),
(
(2015, 2021),
"BiCro lab",
"Karolinska Institutet / Science for Life Laboratory",
),
]
def __str__(self) -> str:
short_cv = f"""
I trained in {self._training_title}, through my studies:\n"""
for years, program, institute in self._studied_at:
short_cv += f" ({years[0]}, {years[1]}) "
short_cv += f"{program} @ {institute}\n"
short_cv += """
I also worked in a few labs:\n"""
for years, lab, institute in self._interned_at:
short_cv += f" ({years[0]}, {years[1]}) "
short_cv += f"{lab} @ {institute}\n"
return short_cv
class BioinformagicianCV(object):
_languages: Dict[LoveLevel, List[Language]] = {
9: ["Python", "R", "rust"],
8: ["bash"],
7: ["JavaScript", "C", "C++", "go"],
6: ["PHP", "MATLAB"],
3: ["Perl", "Java"],
}
_want_to_learn: Language = "Rust and go"
def __str__(self) -> str:
short_cv = f"""
As a bioinformagician, I am currently learning to program
in {self._want_to_learn}, and my favorite languages are:\n"""
for love_level, languages in self._languages.items():
short_cv += f" - {love_level}/10 : "
short_cv += f"{', '.join(languages)}\n"
return short_cv
class MyShortCV(TrainingCV, BioinformagicianCV, SketcherCV):
__name: str = "Gabriele Girelli"
__hometown: Tuple[City, Country] = ("Verona", "Italy")
__now_at: Tuple[City, Country] = ("Stockholm", "Sweden")
__job_title: Title = "Senior Computational Biologist"
__working_at: Tuple[Lab, Institute] = (
"CompBio",
"10x Genomics",
)
__interests: List[str] = [
"genome_architecture",
"fluorescence_in_situ_hybridization",
"computational_oncology",
"bioimaging",
"in_situ_spatial_sequencing",
"single_cell-sequencing",
]
def __str__(self) -> str:
short_cv = f"""
Hi there! My name is {MyShortCV.__name}!
I am originally from {self.__hometown[0]} ({self.__hometown[1]}),
but I am currently based in {self.__now_at[0]} ({self.__now_at[1]})
where I am working as {self.__job_title} at {self.__working_at[0]},
{self.__working_at[1]}.\n
My interests include:\n"""
for interest in self.__interests:
short_cv += f" - {interest}\n"
short_cv += TrainingCV.__str__(self)
short_cv += BioinformagicianCV.__str__(self)
short_cv += SketcherCV.__str__(self)
return short_cv
print(MyShortCV())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment