smoia | |
@SteMoia | |
s.moia.research@gmail.com |
Donostia, 22.11.23
Faculty of Psychology and Neuroscience, Maastricht University, Maastricht, The Netherlands; physiopy (https://github.com/physiopy)
Donostia, 22.11.23
Faculty of Psychology and Neuroscience, Maastricht University, Maastricht, The Netherlands; physiopy (https://github.com/physiopy)
The Turing Way Community, & Scriberia, 2022 (Zenodo). Illustrations from The Turing Way (CC-BY 4.0)
Guaranteeing reproducibility is important for "reusable, transparent" research.
1
2
3
4
Open (Source Scientific Deliverable) Development: the idea of developing a scientific deliverable:
Two main elements: the deliverable itself and the community around it.
The deliverable is not necessarily code based!
Independently from its kind, projects can accept different types of contributions.
Different communities may have different entry requirements, contribution recognitions, or follow different contribution workflows.
Look for a contributors' guidelines
(and a code of conduct).
Minimum Viable Product | Unique features |
---|---|
The necessary features |
The feature nothing else has |
Synergies | Competitors |
---|---|
Projects or deliverables that match (part of) the must have features - How can I collaborate with them? |
Projects that offer the same but do not accept collaboration - Why? |
Minimum Viable Product | Unique features |
---|---|
Description of practical operations Cover respiratory data Cover cardiac data Bad data examples |
Community driven Version controlled Yearly reviewed |
Synergies | Competitors |
---|---|
neurokit ICP Network physIO toolbox Pinto 2018 paper |
... |
A work that is not licensed is not public (paradox!)
There are n+1 (open source) licences to pick up from.
www.choosealicense.org
The licence should be the first commit you make in a project.
Personal picks for science:
Apache 2.0 and CC-BY-ND-4.0
(consider L-GPLv3.0, and CC-BY-4.0 too)
EPFL is the owner of its employees’ inventions and software. Inventors or authors in case of software have the right to one-third of net revenue resulting from the commercialization of their inventions with some exceptions according to directives.
[...]
if __name__ == "__main__":
_main(sys.argv[1:])
"""
Copyright 2022, Stefano Moia & EPFL.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
© Sebastien Adams, I WANT TO DISTRIBUTE MY SOFTWARE DEVELOPMENTS. HOW TO DEFINE AN OPEN LICENSING STRATEGY?
© Benjamin Jean (2011), Option libre. Du bon usage des licences libres.
MATLAB users:
Python users:
[...]
I can't work on that project now because my colleague/friend/dog is working on [a different part than what I'd modify of] it at the moment...
Version control systems are a way to manage and track changes to files.
Content
Aggregation/delivery
pip install pre-commit # Install via pip, or
# Comes installed with development extras
pip install -e /path/to/phys2cvr[dev]
cd /path/to/phys2cvr
pre-commit init
pre-commit run
(Local and remote) simple automations, e.g:
Bonus: it can force a team to double check projects!
Testing a project is as important as developing it.
Arguably, it's even more important, so spend time on it!
There are multiple types of tests:
Releases make your work easier to retrieve (and cite).
Imagine them as hard links to a certain moment in time.
(e.g. paper #1 vs paper #2).
You can create, package, and distribute releases, all automagically through automatic workflows.
*feat Giulia's laptop
{
"license": "Apache-2.0",
"title": "physiopy/phys2bids: BIDS formatting of physiological recordings",
"upload_type": "software",
"creators": [
[...]
{
"orcid": "0000-0002-7796-8795",
"affiliation": "Florida International University",
"name": "Katie Bottenhorn"
},
[...]
],
"access_right": "open"
}
If your project is software related, think about publishing it.
While there are various journals that can be targeted for a software publication, JOSS is free and completely integrated in GitHub.
If your deliverable is data, SOPs,
or documentation:
publish those as well!
Automated workflows are your friend.
Everything can be automated, from testing to releasing (packaging end etc.).
Workflows can require a bit more work to be set up, but they can save a lot of time and energy in the long run!
pip install pre-commit # Install via pip, or
# Comes installed with development extras
pip install -e /path/to/phys2cvr[dev]
cd /path/to/phys2cvr
pre-commit init
pre-commit run
Take advantage of the marketplace: there is a very high probability that what you are looking for is already available.
Depending on the community and the governance scheme, contributions might be recognised differently.
Be clear about how you will recognise contributions.
One way of recognising contributors is the all-contributors specification.
Improve the readability of your deliverable
a, b = rui()
c = s(a, b)
p(c)
a, b = read_user_input()
c = sum_two_numbers(a, b)
print(c)
def very_important_function(template: str, *variables, file: os.PathLike, engine: str, header: bool = True, debug: bool = False):
"""Applies `variables` to the `template` and writes to `file`."""
with open(file, 'w') as f:
...
def very_important_function(
template: str,
*variables,
file: os.PathLike,
engine: str,
header: bool = True,
debug: bool = False,
):
"""Applies `variables` to the `template` and writes to `file`."""
with open(file, "w") as f:
...
https://github.com/TheAxonLab/hcph-sops
1. Gorgolewski, et al., 2016 (Scientific Data) 2. Zwiers, Moia, Oostenweld, 2022, (Front. Neuroinf.)
Bootstrap: docker
From: python:3.8.13-slim-buster
%environment
export DEBIAN_FRONTEND=noninteractive
export TZ=Europe/Brussels
%post
# Set install variables, create tmp folder
export DEBIAN_FRONTEND=noninteractive
export TZ=Europe/Brussels
# Prepare repos and install dependencies
pip3 install nigsp[all]
# Final removal of lists and cleanup
rm -rf /var/lib/apt/lists/*
FROM python:3.8.13-slim-buster AS nigspdock
WORKDIR /app
# Prepare environment
COPY .. .
RUN pip3 install .[all]
ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"
CMD nigsp
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="NiGSP" \
org.label-schema.description="NiGSP: python library for Graph Signal Processing on Neuroimaging data" \
org.label-schema.url="https://github.com/miplabch/nigsp" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/miplabch/nigsp" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"
Docker
Apptainer
...you for the (sustained) attention!
...the organisers, for having me here
...the Physiopy contributors
smoia | |
@SteMoia | |
s.moia.research@gmail.com |
(and for taking care of BHD!)