Skip to content

Commit

Permalink
Try to build README from sections and code
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmfish authored Sep 6, 2024
1 parent d7d31fd commit 183c470
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 205 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/argparse_help_to_readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Pylint

on:
pull_request:
paths:
- "docs/*.md"
- "src/sim_recon/cli/parsing.py"
- "src/sim_recon/settings/formatting.py"

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Get argparse help outputs
run: |
cd src/sim_recon/cli
export OTF_HELP_OUTPUT=$(python -c "import parsing; parsing.parse_otf_args(("--help",))")
export RECON_HELP_OUTPUT=$(python -c "import parsing; parsing.parse_recon_args(("--help",))")
- name: Get sections
run: |
cd docs/sections
for file in *; do
if [ -f "$file" ]; then
var_name=${file^^}_SECTION
# Export file contents to <FILENAME>_SECTION
export "${!var_name}"= <"$file"
envsubst < "${!var_name}"
fi
done
- name: Fill template
run: |
cp -f docs/template.md README.md
envsubst < README.md
205 changes: 0 additions & 205 deletions README.md

This file was deleted.

18 changes: 18 additions & 0 deletions docs/sections/command_line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### CLI

##### sim-otf
```
${{ env.OTF_HELP_OUTPUT }}
```


##### sim-recon
```
${{ env.RECON_HELP_OUTPUT }}
```

##### dv2tiff
Accepts a list of DV files to be converted to TIFFs (with some OME metadata).

##### otf-view
Accepts a list of OTF files (DV or TIFF), the amplitude and phase of which will be plotted.
14 changes: 14 additions & 0 deletions docs/sections/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Configuration
Calls to `sim-otf` and `sim-recon` can both take a `-c`/`--config` argument. This should be similar to the `config.ini` file in the configs directory, which specifies the defaults config, any per-channel configs (some values should be set on a per-channel basis), and the locations of OTFs for each channel.
The channels are specified based on the emission wavelength in nanometres (must be an integer).
##### Example:
For a channel with an emission wavelength of 525nm:
- In the `[configs]` section, the channel config can be specified as `525=/path/to/configs/525.cfg`
- In the `[otfs]` section, the channel OTF file can be specified as `525=/path/to/otfs/525_otf.tiff`
A directory can be specified within each of the `[configs]` and `[otfs]` sections. If given, files can also be defined relative to that directory, e.g. if `directory=/path/to`, then `525=/path/to/otfs/525_otf.tiff` could simply be `525=otfs/525_otf.tiff`.
Config settings will be overriden by higher-priority sources.

##### Order of setting priority:
1. Command line arguments (override all)
2. Per-channel configs (override defaults for the appropriate channel only)
3. Defaults (override any cudasirecon defaults)
22 changes: 22 additions & 0 deletions docs/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# PySIMRecon

Easy to use wrapper for pyCUDAsirecon, allowing the use of DV (DeltaVision) files without IVE/Priism (UCSF library with MRC/DV support).

This is built for easy use from the command line or as part of an auto-processing pipeline, allowing parameters to be pre-configured or defined at runtime.

### Goal

To reconstruct the SIM data and create OTFs from PSFs from the cryoSIM at B24, Diamond from the .dv files created by Cockpit. Requirements are:

- Easy to use
- Open source
- Reproducable results
- Can be used as part of an automatic processing pipeline

### Current state

Under development

${{ env.CONFIGURATION_SECTION }}

${{ env.COMMAND_LINE_SECTION }}

0 comments on commit 183c470

Please sign in to comment.