Skip to content

Commit

Permalink
Add simple mkdocs documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
teekuningas committed Feb 22, 2024
1 parent 401df59 commit 5844aa5
Show file tree
Hide file tree
Showing 21 changed files with 155 additions and 240 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy gh-pages

on:
push:
branches:
- 'update-environment'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs
- name: Build and deploy
run: |
mkdocs gh-deploy -b gh-pages-test --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
sphinx/build
sphinx/source/*meggie*
meggie/.coverage
.coverage
*.swm
*.pyc
*.swm
Expand All @@ -14,6 +10,7 @@ conda-bld
dist
meggie.egg-info
preferences.cfg
site
*.~lock.*
*.orig
.project
Expand Down
35 changes: 1 addition & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,7 @@

## Documentation

* User documentation is found here: *http://meggie.teekuningas.net*
* Developer documentation is found here: *https://cibr-jyu.github.io/meggie*

[//]: # (Hello)

## Installation (from terminal)

Note that Python>=3.8 might be required to get the newest version.

### From conda-forge (mamba instead of conda might install faster):

1. Install meggie to a conda environment: conda create -n meggie-env -c conda-forge meggie=1.6.3
1. Activate the environment: conda activate meggie-env
1. Run: meggie

### Using this repository:

1. Clone this repository to /path/to/meggie/repo
1. Create virtual environment: python -m venv /path/to/meggie-env
1. Activate the environment: source /path/to/meggie-env/bin/activate
1. Enter the repository: cd /path/to/meggie/repo
1. Install dependencies: python -m pip install -r requirements.txt
1. Install meggie: python -m pip install .
1. Run: meggie

[//]: # (Hello)

## Debugging

* If command *meggie* is not found, you should ensure that you are in the correct python environment.
* If the command is found, but the software crashes during startup to an *ImportError*, you should ensure that you are using *Python 3* and that the dependencies are installed. Individual missing dependencies can often be installed with either *conda install* or *pip install*.
* If the software crashes during analysis or startup, and the terminal window does not show you the stacktrace, you can start meggie using command *meggie debug* and then the next crash will come with a stacktrace.

[//]: # (Hello)
See *https://cibr-jyu.github.io/meggie* for installation and usage.

## License

Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
black
pylama
nose
mkdocs
18 changes: 18 additions & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# About Meggie

Developed at the Jyväskylä Centre for Interdisciplinary Brain Research (CIBR), Meggie is the result of a project that started in 2013, with the mission to make sophisticated M/EEG analysis accessible to all researchers. Meggie builds upon the MNE-Python library to deliver a robust set of features through an intuitive interface.

## Design Philosophy

Meggie focuses on:

1. **Multi-Subject Management**: It makes it easy to work with many subjects' data at once.
2. **Clear Analysis Steps**: It helps users go step by step from starting data to results.

Compared to other tools like FieldTrip, MNE-Python, EEGLAB, Brainstorm, and mnelab, Meggie is unique because it's built with Python, it's easy for anyone to use, and it's designed for handling multiple subjects' data efficiently.

## Plugins

Meggie can be changed and added to with plugins. If you know Python, you can create new features. This helps Meggie grow and helps everyone who uses it.

To learn more, see our [Developer Documentation](./developer-guide/development.md).
Original file line number Diff line number Diff line change
@@ -1,49 +1,33 @@
Architecture
============
# Prerequisites

This document provides a broad overview with some insights to how meggie is built and how that can be used for advantage.

Main classes
------------
## Main classes
There are three basic structures in Meggie.

MainWindow
**********
### MainWindow
MainWindow contains the user interface, and is implemented with PyQt5. The most important elements of the MainWindow are the left panel, holding experiment-specific information, the bottom console, which logs user actions, and the right panel, which contains the tabs that are used for data transformations.

Experiment
**********
### Experiment
Experiment contains the highest-level container for all the data. It implements logic for saving and loading experiments and stores subjects within it.

Subject
*******
### Subject
Subjects are added to experiments and store subject-specific data. Most importantly they are responsible for saving and loading the raw data, but they also store instances of datatypes.

Actions, pipelines and datatypes
--------------------------------
## Actions, pipelines and datatypes
The analysis functionality is based on three key structures: actions, pipelines and datatypes.

Datatypes
*********
Often the raw data can be summarized in structures that capture the essential features for the purpose of analysis. For example, based on event information, the raw data can split into small segments of data that are averaged together to create event-related responses. These kind of structures, e.g. epochs, evokeds, spectrums, TFRs, that are instantiated from prespecified datatypes, can be stored within subjects. In meggie, these "blueprints" are all stored, declared and implemented in the datatypes folder.
### Datatypes
Often the raw data can be summarized in structures that capture the essential features for the purpose of analysis. For example, based on event information, the raw data can split into small segments of data that are averaged together to create event-related responses. These kind of structures, e.g. epochs, evokeds, spectrums, TFRs, that are instantiated from prespecified datatypes, can be stored within subjects. In meggie, these “blueprints” are all stored, declared and implemented in the datatypes folder.

Actions
*******
Actions are basic analysis steps such as "filter" or "create epochs". In Meggie, each one of these is declared independently in its own folder within "actions" folder. Each action consists of metadata in "configuration.json" and python code. The entry point within the python code is assumed to inherit from the Action-class defined in mainwindow/dynamic.py. If done so, the actions can be embedded in pipelines, and are automatically logged in a backlog of actions.
### Actions
Actions are basic analysis steps such as “filter” or “create epochs”. In Meggie, each one of these is declared independently in its own folder within “actions” folder. Each action consists of metadata in “configuration.json” and python code. The entry point within the python code is assumed to inherit from the Action-class defined in mainwindow/dynamic.py. If done so, the actions can be embedded in pipelines, and are automatically logged in a backlog of actions.

Pipelines
*********
Pipelines are sets of actions arranged as buttons within tabs in the GUI and correspond to certain types of analyses from the beginning to the end such as "Sensor-level continuous data analysis" or "Source-level evoked response analysis". These are declared in the main configuration.json and as they utilize the actions for implementations, they do not include any python code.
### Pipelines
Pipelines are sets of actions arranged as buttons within tabs in the GUI and correspond to certain types of analyses from the beginning to the end such as “Sensor-level continuous data analysis” or “Source-level evoked response analysis”. These are declared in the main configuration.json and as they utilize the actions for implementations, they do not include any python code.

Plugins
-------
Creation of plugins is simple. Pipelines, datatypes and actions are dynamically located at the runtime and are loadable from other python packages from meggie_* namespace. Thus implementing a plugin corresponds to creating a python package (with name in the meggie_* namespace) which introduced pipelines, actions and/or datatypes.
## Plugins
Creation of plugins is simple. Pipelines, datatypes and actions are dynamically located at the runtime and are loadable from other python packages from meggie namespace. Thus implementing a plugin corresponds to creating a python package (with name in the meggie namespace) which introduced pipelines, actions and/or datatypes.

API
***
## API
We thrive to keep the core of Meggie, which covers everything but the actions, as stable and reusable as possible. Thus as a plugin developer, you are allowed to use the API of MainWindow, Subject and Experiment classes, the four datatypes provided in the datatypes folder, as well as the functions, dialogs and widgets stored in the utilities folder.

Where to start
**************
See the code for simplest possible plugin `here <https://github.com/cibr-jyu/meggie_simpleplugin>`_.
To see it in use, see `the user documentation <http://meggie.teekuningas.net>`_.

2 changes: 2 additions & 0 deletions docs/developer-guide/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Plugin development
Contents be here.
2 changes: 2 additions & 0 deletions docs/developer-guide/setting-up.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Setting up
Contents be here.
13 changes: 13 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Welcome to Meggie

Meggie is an open-source software designed for intuitive MEG and EEG analysis. With its user-friendly graphical interface, Meggie brings the powerful analysis methods of MNE-Python to researchers without requiring programming skills.

## Key Features

- **Cross-Platform**: Runs on Linux, macOS, and Windows.
- **User-Friendly**: Simple graphical user interface for ease of use.
- **Efficient Workflows**: Supports multi-subject experiments and pipeline processing for streamlined analysis.

Get started with Meggie and explore its features to simplify your MEG/EEG analysis.

[Getting Started](./user-guide/getting-started.md)
2 changes: 2 additions & 0 deletions docs/user-guide/actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Actions
Contents be here.
3 changes: 3 additions & 0 deletions docs/user-guide/experiments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Experiments

Contents be here.
42 changes: 42 additions & 0 deletions docs/user-guide/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Installation

Meggie does not have standalone installers, but it can be easily installed on Windows, macOS, or Linux systems with Python 3.9 or higher using either of the following methods:

## Using conda

Install meggie to a conda environment:
```bash
$ conda create -n meggie-env -c conda-forge meggie=={{VERSION}}
```

### Using pip:

Create a virtual environment:
```bash
$ python -m venv meggie-env
```
Activate the environment:
```bash
$ source .meggie-env/bin/activate
```
Install dependencies:
```bash
$ pip install -r https://github.com/cibr-jyu/meggie/blob/{{VERSION}}/requirements.txt
```
Install meggie:
```bash
pip install meggie=={{VERSION}}
```
# Starting meggie for the first time
Activate the environment in which Meggie was installed. For conda:
```bash
conda activate meggie-env
```
For pip:
```bash
source meggie-env/bin/activate
```
Then run Meggie:
```bash
$ meggie
```
24 changes: 24 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
site_name: Meggie
site_url: https://cibr-jyu.github.io/meggie

nav:
- Home: index.md
- About: about.md
- User Guide:
- Getting Started: user-guide/getting-started.md
- Experiments: user-guide/experiments.md
- Actions: user-guide/actions.md
- Developer Guide:
- Setting up: developer-guide/setting-up.md
- Architecture: developer-guide/architecture.md
- Development: developer-guide/development.md

theme:
name: readthedocs

# Extensions
markdown_extensions:
- toc:
permalink: true
- admonition
- codehilite
20 changes: 0 additions & 20 deletions sphinx/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions sphinx/make.bat

This file was deleted.

15 changes: 0 additions & 15 deletions sphinx/rebuild.sh

This file was deleted.

Binary file removed sphinx/source/_static/logo.png
Binary file not shown.
9 changes: 0 additions & 9 deletions sphinx/source/_static/styles.css

This file was deleted.

Loading

0 comments on commit 5844aa5

Please sign in to comment.