Break
This is a time for you to get some refreshment and clear your mind a little in preparation for the next part of the workshop.
Workflow checklist
Overview
Teaching: 5 min
Exercises: 20 minQuestionsObjectives
What will I do?
When will I do it?
How will I remember to?
Be confident you’ll remember to implement the skills learned here today.
How to use this checklist
- Copy the checklist to a new document.
- For each item, think about what it involves, and when you will do it.
- Consider how you might remind yourself to do it, or persuade yourself to make time for it.
- As you come up with your answers, write them in the space provided, or tick one of the existing suggestions.
- The suggestions are roughly in the order of recommended best practice.
- When you’ve answered all the points in a section, tick it off.
Checklist
Licensing [ ]
- I will find out who will be the rights holder for the software
- When I apply for funding
- At the beginning of the project
- When I put the code on a repository
- When I make the repository public
- When ………….. gets back to me, and I’ll chase them if they haven’t by ……………………………
- ………………………………………………………………………………………………….
- I will decide on what license to apply to the software
- When I’ve found out who the rights holder is
- When I make the repository public
- ………………………………………………………………………………………………….
- I will review the license applied to the software
- When I add new dependencies
- ………………………………………………………………………………………………….
Documentation [ ]
- I will write instructions for using the code
- When I start to write code
- When I put my code on a repository
- ………………………………………………………………………………………………….
- I will document the code using
- Recognised standard tools (e.g. Doxygen)
- Separate documents
- Inline comments
- ………………………………………………………………………………………………….
- I will update the documentation
- As I make changes to the code
- _At a set time each day/week/month/…………………………………………………………………………………………………
- Before I publish a new version
- ………………………………………………………………………………………………….
- I will publish the documentation
- Automatically using continuous integration
- Whenever I publish a new version of the software
- ………………………………………………………………………………………………….
Code [ ]
- I will make the code readable
- As I write it
- Once things are working like they should
- Before I publish a new version
- ………………………………………………………………………………………………….
- I will organise my files
- Using a well-planned and clear directory structure
- ………………………………………………………………………………………………….
Dependencies [ ]
- I will make sure my dependencies are listed
- Using a full environment management system (e.g. Docker, Apptainer)
- Using automated dependency management tools (e.g. conda, renv)
- By automatically documenting them when the code runs
- By including them in the documentation
- ………………………………………………………………………………………………….
- I will review my dependency list
- Automatically using dependency management tools
- When I add or remove a dependency
- Before I publish a new version
- ………………………………………………………………………………………………….
Tests [ ]
- I will test my software
- Using a testing framework (e.g. Cypress, pytest, testthat)
- By having a set of things I do every time
- ………………………………………………………………………………………………….
- I will run my software tests
- Automatically using continuous integration
- Before I push to the repository
- Before I publish a new version
- ………………………………………………………………………………………………….
Repository [ ]
- I will upload my code to
- A dedicated code repository (e.g. GitHub)
- A well-resourced repository (e.g. OSF, FigShare, Zenodo, university repositories)
- A personal website
- ………………………………………………………………………………………………….
- I will make the code publicly accessible
- By enabling the approriate permissions in the repository
- By publishing specific versions
- ………………………………………………………………………………………………….
Publishing [ ]
- I will publish my code by
- Issuing releases on a code repository
- Ensuring the code repository is publicly accessible
- ………………………………………………………………………………………………….
- I will do this
- Whenever milestones are reached
- Whenever I publish a related output (e.g. research paper)
- Automatically whenever I push to the repository
- ………………………………………………………………………………………………….
Referencing [ ]
- I will make my code citable by
- Publishing specific releases with a DOI (e.g. via Zenodo)
- Writing a technical/methods paper and submitting it to a journal
- Citing specific releases directly
- Citing the repository with a time/version stamp
- Citing the repository only
- ………………………………………………………………………………………………….
- I will do this
- When I publish the code
- When I publish a related output
- ………………………………………………………………………………………………….
Collaboration [ ]
- I will make it
easy for others collaborate
on my code by (tick all that apply)
- Using collaboration-friendly services like GitHub
- Writing a welcome guide for new contributors
- Having easy templates for users to submit bug reports and feature requests
- Ensuring a welcoming attitude for contributors
- ………………………………………………………………………………………………….
- ………………………………………………………………………………………………….
- ………………………………………………………………………………………………….
- ………………………………………………………………………………………………….
Rights and Licensing
Overview
Teaching: 10 min
Exercises: 10 minQuestionsObjectives
What is licensing?
Do I need to license my work?
Who owns the rights to my work?
Understand what parts of your university’s rights and licensing policy apply to you.
Know where to get help.
What is licensing?
When software is created it is automatically copyrighted. The owner of the copyright (the ‘rights holder’) can do things with it that other people can’t. A license lets people do things that they couldn’t otherwise do.
Normally, we can’t legally copy someone else’s intellectual property, for example. We normally can’t sell it. And we definitely can’t sell it and claim that we made it ourselves. These are examples of rights that we would infringe upon without an appropriate license. Most software licenses you’re familiar with will let you copy software, at least once to put it on your computer. Other licenses will let you make more copies, and distribute them – some will even let you sell the software or versions of it that you extend. Certain very ‘broad’ licenses waive all rights (i.e. you still have those rights but you’ve agreed that nothing people do will infringe them).
Do I really need to license stuff?
Yes. If you don’t, no one can do anything with your code or software. And, if you have collaborators, no one includes you.
What kind of licenses are there?
The major kinds of licenses we’re concerned about are open source licenses. These licenses embrace four freedoms:
- The freedom to use
- The freedom to modify
- The freedom to distribute
- The freedom to distribute modifications
You can get a good idea of which open source license is right for you by looking at https://choosealicense.com/.
Of course, you can choose any of a large number of different licenses (or write your own), but established licenses give people confidence to run and build on your software. The more custom a license is, the more people will worry about unintended effects.
Who decides what license to use?
The license must be decided by the rights holder. If you’re writing software on your own at home, this is almost certainly you. There may, however, be other considerations. While it’s not a strict hierarchy, the rough order to check is:
- Your software might include components that place restrictions on modifications
- E.g. ‘Copyleft’ licenses mean you can’t apply a closed license to software that includes copylefted work
- Whoever funds your research may have rules about who owns what you produce and how it’s licensed
- Your employer (i.e. university) will probably be the rights holder for software you develop as part of your job
- Universities are usually happy to grant you the rights to software you’ve written provided you can show that it has no realistic commercial development opportunities
Finding out
10 min
Take ten minutes now to find out who is the rights holder for your current project. If you don’t have a current software/code-writing project, who would hold the rights if you did?
- If you have already written software, does it have dependencies that have copyleft licensing?
- If not, it’s possible you may be forbidden from building on these works.
- This is unlikely, but it can happen.
- Check your funding arrangement if you have one – it might say who is the rights holder for work you produce, or perhaps state which licenses you can use.
- Check your university policy.
- This may be different for students.
- and faculty .
- If none of these say anything relevant, then you are the rights holder and you can use any license you like. If you don’t care, use a public domain license like the unlicense.
Totally lost?
Take this time to send an email to your supervisor, librarian, administrator, or someone else who might be able to answer the question “who owns code/software that I write in my research?”
By now you should know who will be the rights holder for code and software you write. You should know how to ask them to let you choose an appropriate license for your code or software. If you run into difficulties, you should know where to get help.
New Lesson
Overview
Teaching: 10 min
Exercises: 20 min
The text of your lesson will go here. It can make use of markdown formatting, as well as the special callout zones in The Carpentries’ template.
Template
Why share?
Overview
Teaching: 0 min
Exercises: 30 min
Enumerating the benefits
5 min
In small groups, try to think of reasons people share code and software. Using the collaborative notes document, jot down any ideas you come up with, so that we have an overall list at the end.
Ideas
Some reasons that are commonly cited are:
- Shared software can be built on by others
- Shared code can be checked by others
- Shared software can be maintained by others
- Extensions to some software have to be shared due to copyleft licensing
- It’s possible to audit and verify shared software
- Sharing software helps you hold yourself to higher coding standards
Considering the concerns
5 min
In the same groups, try to think of reasons people might hesitate to share code or software. Again, use the collaborative notes document to jot down any ideas you come up with.
Ideas
Some reasons that are commonly cited are:
- If I share my code, people will find mistakes in it, and that would be embarrassing
- My software is badly built, or my code is messy, and it’s embarrassing
- It takes time to learn how to share and do the sharing – time I don’t have
- I don’t want to maintain my code or software, and I’d feel obliged to if I shared it
- My software won’t be as impressive if people can see how it works
- People could use adapt my software for purposes I don’t agree with
- I worked hard on this code and I don’t want other people to benefit from my work
Your experiences
10 min
Now we have listed some benefits and concerns of sharing, go around your small group and have each group member identify two items that they have experience with. You can choose a benefit and a concern, or two benefits or even two concerns. For each one, share your experience of it with your colleagues. If you have time, add a brief note about your experience to the collaborative notes document, but the focus should be on sharing with your colleagues and listening to what they have to say.
Addressing concerns
10 min
We have a list of concerns that people in your workshops might have. It’s helpful to be able to provide some perspective on those concerns – we want to acknowledge that sharing can be frightening or difficult, but highlight that it is worth doing anyway!
Again, in your group, choose two of the concerns. If they are concerns you have or have had yourself, that’s ideal, but they could also be ones that you just find interesting. Go around the group, discussing each person’s concerns. Try to think of reasons why the concern should not hold you back from sharing your code and software. If you can’t think of anything, try asking the larger group or one of the workshop instructors or helpers.
Remember, it’s not wrong to have concerns! We believe that sharing data and code is important and that the benefits outweigh the concerns, and we’d like to help you understand why and give you any encouragement you need.
Key Points
People share code and software for many reasons
Shared software can be extended
Shared software can be evaluated
Bugs can be found and fixed