Tag Archives: python

Project List

The main purpose of this blog is to keep track of my various projects and to document them. The end result would be a long list of projects with all the associated metadata which can then be summarised to make browsing them easier. The Project List is a meta project that does just that. Each project on my website gets a file named project.php associated with it that contains the meta information. They are then gathered by the Project List and can be sorted, filtered, and displayed online. I’ve also added static pages, blogs, and talks to the lists of resources. You can view the Project List to read more it. This was tied in to a major update of my website, as I had to create new preview images and new styles to match the new way of showing the projects. This will probably evolve further over time, but for now it’s fine.

Screenshot

Project List, showing some projects
Project List, showing some projects

Project management

Here’s something special for the 100th post! It’s project I use to manage projects.

This project was made to manage other projects. Each project has its own metadata which is parsed and arranged to give a useful summary of what the project does, how it was developed, and what I learned during development.

Links

Blog
GitHub repository

Overview

Each project has a python script that summarises the metadata, including the GitHub repository, the relevant links, a short description of the project, and details of implementation. Summaries are made for the Projects WordPress blog, and special links made for the PHP pages for projects that are hosted on my website. The scripts are organised so that they iterate over all projects (currently 83 and growing) at once, allowing a summary of all projects to be formulated.

This project management will eventually be extended to include icons, images, and other useful information. So far this has mostly be used to allow me to catalogue my existing projects in my spare time, which has taken ~15 months, but now that is nearly complete my needs will change, so I will add new functionalities.

Challenges

Challenge: This project needs to be versatile enough to handle a lot metadata about many projects.
Solution: In order to accommodate so many projects I had to create a new top level directory in my user space which is arranged hierarchically by category to contain all the projects. The choice to use python is motivated by the need to have a project management system that is versatile enough to handle a wide divrersity of projects with different metadata. (Resolved.)
This is how the sausage is made...
This is how the sausage is made…

ScramBuildEggs

This project parses a build log and gives more intuitive output.

Links

GitHub repository

Overview

This is a script that parses the build log created by the CMSSW command “scram build” (hence the name!) It takes the output, wraps it to a more readable width, splits errors by type and colours them, and also gives more useful output. It’s not complete yet, but it is already rather useful.

Screenshot

ScramBuildEggs screenshot
ScramBuildEggs screenshot

SCP

Here is where I put my content relevant to the SCP Wiki.

Links

Live page
SCP Wiki
GitHub repository

Overview

The SCP Wiki is description of a fictional emergency containment facility. This project collects mostly attempts at writing articles, and anything else relevant to the SCP, including the python script.

Challenges

Challenge: The python script has to make an HTTP request and keep the user entertained while it handles the request.
Solution: This was the first time I used python with HTTP requests, which turned out to be quite easy. The script produces a series of messages to emulate the security steps needed to access the articles. (Resolved)
Challenge: It would be nice to have ASCII images appear.
Solution: Most SCP articles contain small images, and I’ve already worked with ASCII art elsewhere, so it should be a matter of putting the two together, when I get time. (To be done)

python screenshot

SCPython screenshot
SCPython screenshot

CERN Open Data (CMS)

In 2014 the CMS experiment at CERN released their 2010 data to the public for analysis. As a quick exercise I decided to analyse the dimuon mass spectrum to show that this could be done in a reasonable amount of time.

Links

Live page
GitHub repository

Overview

The input file is the 2010 Run B comma separated values file. The python script then produces mass spectra for same sign and opposite sign mass spectra and zooms in on the interesting regions.

Challenges

Challenge: The main challenge was that this project was made as quickly as possible.
Solution: This project uses python and existing ROOT libraries for the maximal development speed. The other data format available was using CMSSW and a virtual machine. In principle using CMSSW should be straightforward, but I decided against using this because the software was already four years old and support would be minimal or non-existant, even to current CMS physicsts. (Resolved)

Sample output

Charmonia dimuon spectra
Charmonia dimuon spectra
Full dimuon spectra
Full dimuon spectra
Bottomonium dimuon spectra
Bottomonium dimuon spectra

ROOT colors

This project creates an infographic showing the ROOT colors and how they relate to each other.

Links

ROOT page
GitHub repository

Overview

Physicists use ROOT to make plots and it’s often useful to be able to easily browse the color space. ROOT provides a color wheel, but I find the rectangular display very useful as well. In principle, colors in the same column should suit each other, which makes the rectangular display more useful than the color wheel.

Sample output

Rectangular array of ROOT colors
Rectangular array of ROOT colors

Accelerator future prospects plot

This project was written as part of the content for a talk presented at the International Workshop on Future Linear Colliders to compare the future prospects of the LHC and lepton colliders. It is shared here in case it is of use for other physicists.

Links

GitHub repository

Overview

This project simply plots a series of graphs.

Challenges

Challenge: Using a TMultigraph in pyroot is not easy.
Solution: In order to make this work I had to use the array module, a step I usually forget! This macro should save me a few headaches in the future. (Resolved.)

Output

Future prospects of various accelerators
Future prospects of various accelerators

Project Euler solutions

To hone my problem solving skills I occasionally take part in Project Euler, which is a series of mathematical and computational problems. These pages summarise my solutions and strategies.

Links

Live page
GitHub repository

Overview

This is just a collections of pages that show solutions to the problems. There’s nothing particularly special about these pages.

Screenshot

Project Euler solutions screenshot
Project Euler solutions screenshot