Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slan to ImodModel attribute and IMAT to ImodModel.object attribute + testing & documentation #20

Merged
merged 16 commits into from
Jun 13, 2024

Conversation

braxtonowens
Copy link
Collaborator

  1. I incorrectly made Slicer angles an ImodModel.object attribute in Parse SLAN Chunks #17. It is now an ImodModel attribute.
    IMAT is now an ImodModel.object attribute instead of an ImodModel attribute.

  2. Added mod file with multiple objects along with testing.

  3. Added documentation for using ImodModel.

braxtonowens and others added 6 commits June 7, 2024 11:03
2. Added an example file with multiple objects
3. Added testing for the file with multiple objects.
Made slans a model attribute and imat an object attribute. Added new
test example file and tests to the model_api. Added documentation on
using ImodModel.
@alisterburt
Copy link
Member

Wonderful - while we're at it, do you think the attribute should be .slan or .slicer_angles?

I'm fine with either but prefer the aesthetics of slicer_angles - if we go with slicer_angles can we update the selector for annotation type where it's 'slan' too?

Great work as always @braxtonowens !

@alisterburt
Copy link
Member

Looks like you have some merge conflicts, you'll have to rebase on main

@braxtonowens
Copy link
Collaborator Author

Yeah, I like slicer_angles better.

Copy link
Member

@alisterburt alisterburt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Minor consistency/style things - merging as soon as tests pass, thanks @braxtonowens !

docs/index.md Outdated Show resolved Hide resolved
src/imodmodel/dataframe.py Outdated Show resolved Hide resolved
docs/index.md Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/test_functional_api.py Outdated Show resolved Hide resolved
tests/test_parsers.py Outdated Show resolved Hide resolved
@alisterburt alisterburt merged commit 5908efc into teamtomo:main Jun 13, 2024
5 checks passed
@alisterburt
Copy link
Member

@braxtonowens I've given you maintenance powers on the repo - let's still discuss things over PRs with the other but you're doing a great job and should have the ability to move the project forward 🙂

Would you like to trigger the deployment workflow with this new code so that it's available on PyPI?

The deployment workflow is stored here:

name: tests
on:
push:
branches:
- master
- main
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches:
- master
- main
workflow_dispatch:
jobs:
test:
name: ${{ matrix.platform }} py${{ matrix.python-version }}
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ ubuntu-latest ]
python-version: [
"3.8",
"3.9",
"3.10",
"3.11",
]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools pytest pipx
pip install -e .
pipx install hatch
- name: Test with pytest
run: hatch run all:test -v -p no:warnings tests
env:
PLATFORM: ${{ matrix.platform }}
- name: Coverage
uses: codecov/codecov-action@v1
deploy:
# this will run when you have tagged a commit, starting with "v*"
# and requires that you have put your twine API key in your
# github secrets (see readme for details)
needs: [ test ]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
run: |
git tag
python -m build
twine upload dist/*

If you take a look at that workflow you'll see it is trigger when a 'tagged commit' matching 'v*' is pushed to the main branch.
Deploying will look like:

one time things

  • making sure your local main branch is in sync with the main branch here
  • setting this repository as a remote called 'upstream' (git remote add upstream [email protected]:teamtomo/imodmodel.git)
  • making your local main branch track the upstream branch (git branch -u upstream/main)
  • adding SSH keys to your github account

deployment workflow

  • git checkout main
  • git pull
  • git tag v0.0.13 -m "v0.0.13" (version number follows semver)
  • git push upstream main --follow-tags

Once you do this, you should see things launch in the actions tab of the repository
https://github.com/teamtomo/imodmodel/actions

If you don't want to do this let me know and I'm happy to do it too - only written up in case you would like to learn

@braxtonowens
Copy link
Collaborator Author

Great, I think everything went smooth for v0.0.13. Thanks for the help.

@alisterburt
Copy link
Member

Great!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants