11-02, 10:55–11:35 (America/New_York), Central Park West (Room 6501)
Sciris aims to streamline the development of scientific software by making it easier to perform common tasks. Sciris provides classes and functions that simplify access to core libraries of the scientific Python ecosystem (such as NumPy), as well as low-level libraries (such as pickle). Some of Sciris' key features include: ensuring consistent list/array types; allowing ordered dictionaries to be accessed by index; and simplifying parallelization, datetime arithmetic, and the saving and loading of complex objects. With Sciris, users can achieve the same functionality with fewer lines of code, reducing the need to copy-paste recipes from Stack Overflow or follow dubious advice from ChatGPT.
Background
Scientific software workflows often rely on a mishmash of codebases, including low-level libraries, domain-specific open-source software, and self-developed and/or inherited toolboxes (whose original developer may or may not be around to pass on undocumented wisdom). This leads to proliferation of tools where people spend time reinventing wheels of variable quality, which jeopardizes the ideal of code being "re-runnable, repeatable, reproducible, reusable, and replicable". Beyond these requirements, low-level programming abstractions are often a distraction that get in the way of understanding the actual science. We developed Sciris as a means of streamlining the development of scientific software by making it easier to perform common tasks, similar to how PyTorch simplifies/extends Tensorflow, or how seaborn simplifies/extends Matplotlib.
Methods
Sciris "stands on the shoulders of giants", and as such is not intended as a replacement of other libraries, but rather as an interface that facilitates a more rapid and effective development process. Sciris provides classes and functions that simplify access to frequently used low-level functionality in the core libraries of the scientific Python ecosystem (such as NumPy and Matplotlib), as well as in libraries of broader scope (such as multiprocess
for parallelization and pickle
for saving and loading objects). Some of Sciris' key features include: ensuring consistent dictionary, list, and array types (e.g., enabling users to provide inputs as either lists or arrays); enabling ordered dictionary elements to be accessed by index as well as key; simplifying datetime arithmetic by allowing date input in multiple formats, including strings; simplifying the saving and loading of files and complex objects; and simplifying the parallel execution of code. Some of Sciris' key design features include: (a) brevity through simple interfaces (such as plot3d()
to directly create a 3D plot), (b) "dejargonification" (such as findnearest()
to find the element in an array nearest to the target value), (c) flexible exception handling (allowing users to quickly switch between being strict or forgiving), and (d) version management (such as saving figures with the Git branch/commit information in the metadata). Sciris also forms the basis of ScirisWeb, an additional set of tools for building Flask-based Python webapps.
Conclusion
During the COVID-19 pandemic, Sciris proved invaluable for allowing us to rapidly develop Covasim, a Python-based modeling tool that was used for research and policy decisions in dozens of countries . Sciris also forms the backbone of numerous other scientific software libraries, such as Optima HIV and HIPtool. Sciris makes writing scientific code in Python faster, more pleasant, and more accessible, especially for people without extensive training in software development.
No previous knowledge expected
Cliff Kerr is a Senior Research Scientist at the Institute for Disease Modeling, part of the Bill & Melinda Gates Foundation, where he works on COVID, HPV, and family planning. Previously, he completed a B.Sc. in neuroscience and a Ph.D. in physics, was a lecturer in scientific computing at the University of Sydney, co-founded two startups (on data analytics and health economics), worked on a DARPA project teaching robots to pick up balls, and developed an algorithm that composes music in real time based on brain activity recordings. He is passionate about architecture, cooking, and promoting equity in global health. He lives in New York.