EasyScience is a versatile data analysis framework designed to streamline the journey from data collection to publication. It provides:
- Powerful back-end tools: Core functionality through Python libraries.
- Efficient front-end modules: QML components for developing desktop applications with ease.
- 🔑 Set Up GitHub Access
- 📌 Define the Project in the Organization Profile
- 📦 Create Repositories Using Templates
- 🚀 Push Changes to GitHub
- ⚙️ Repository Configuration
- 🔄 Updating the Repository with Template Changes
GitHub access can be managed via Personal Access Tokens (PATs):
- Go to GitHub → Settings → Developer Settings → Personal Access Tokens.
- Click "Generate new token".
- Select:
- ✅ repo → Full control of repositories.
- ✅ workflow → Access GitHub Actions (optional).
- Click "Generate token" and copy it.
You can now use PAT to interact with GitHub via:
- Terminal (Recommended for advanced users).
- GUI tools (e.g., GitKraken for an intuitive interface).
Each project should first be registered under the EasyScience organization profile.
Edit README.yaml under domain-specific-projects
.
- name → The project name, prefixed with Easy (e.g., EasyDiffraction).
- shortcut → A short, two-letter abbreviation (e.g., ED).
- description:
- main → A brief project description (e.g. Diffraction).
- type → Type of project (e.g., data analysis, data reduction).
- repos:
- home → Home repository name (e.g., diffraction).
- lib → Library repository name (if applicable).
- app → Application repository name (if applicable).
Example (EasyDiffraction)
- name: EasyDiffraction
shortcut: ED
description:
main: Diffraction
type: data analysis
repos:
home: diffraction
lib: diffraction-lib
app: diffraction-app
EasyScience provides predefined Copier templates for new repositories:
To create new repositories within the EasyScience framework, utilize the predefined Copier templates to ensure consistency and streamline the setup process.
The following base template is essential for all projects, regardless of type:
Template | Purpose | Repository |
---|---|---|
project-base |
Foundational project setup | templates-project-base |
In addition to the base template, select one of the following templates based on your project type:
Template | Purpose | Repository |
---|---|---|
project-home |
Home project repository | templates-project-home |
project-lib |
Python package repository | templates-project-lib |
project-app |
Qt QML desktop application repository | templates-project-app |
By combining the base template with the appropriate project-specific template, you can efficiently set up a new repository tailored to your project’s requirements.
Here is an example for creating a new repository diffraction-lib
which will be a Python
library for the project EasyDiffraction
. Creating a new repository diffraction-home
(project home) or diffraction-app
(desktop app) could be done in a similar way.
Create a new repository:
- Navigate to GitHub → Create New Repository.
- Repository template: No template (we will use Copier instead).
- Enter the repository name, e.g.,
diffraction-lib
. - Description: Add a description based on the README.yaml definition from above, e.g., Diffraction data analysis.
- Set repository visibility to Public.
- DO NOT initialize with a README,
.gitignore
, or license (Copier handles these). - Click "Create repository".
git clone https://github.com/easyscience/diffraction-lib.git
cd diffraction-lib
python3 -m venv .venv
. .venv/bin/activate # macOS/Linux
. .venv/Scripts/activate # Windows with Unix like shells
.\.venv\Scripts\activate.bat # Windows with CMD
.\.venv\Scripts\activate.ps1 # Windows with Power shell
pip install copier
copier copy gh:easyscience/templates-project-base ./
(Follow interactive prompts to configure the project.)
copier copy gh:easyscience/templates-project-lib ./ --data-file .copier-answers.project-base.yml
(Follow interactive prompts to configure the project.)
(Note: To ensure the base project definition generated by Copier in the previous step is included,
we use the --data-file
option followed by the path to the answers file)
cd diffraction-lib
git add -A
git commit -m "Initial project setup using Copier templates"
git push origin master
(Alternatively, use a GUI client like GitKraken.)
- Add repository secrets (e.g., API keys, deployment keys).
- Configure branch protection & access control.
cd diffraction-lib
copier update --answers-file=.copier-answers.project-base.yml
git add -A
git commit -m "Updated project structure with latest template"
git push origin master
(Alternatively, use a GUI client like GitKraken.)
(If conflicts arise, Copier will prompt you to review them.)
copier update --answers-file=.copier-answers.project-lib.yml --data-file .copier-answers.project-base.yml
git add -A
git commit -m "Updated Python library structure with latest template"
git push origin master
(Note: To ensure the base project definition generated by Copier in the previous step is included,
we use the --data-file
option followed by the path to the answers file)
(Alternatively, use a GUI client like GitKraken.)
(If conflicts arise, Copier will prompt you to review them.)