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

build: add pip dependencies #233

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions .github/workflows/conda_build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
name: conda_build

name: conda
on:
release:
types: [published]
push:
branches: [ master ]
tags:
- '**'
pull_request:
branches: [ master ]

release: {types: [published]}
push: {branches: [master], tags: ['**']}
pull_request: {branches: [master]}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: publish-to-conda
uses: paskino/conda-package-publish-action@v1.4.4
- uses: actions/checkout@v4
with:
subDir: 'recipe'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }} # fix SHA
- uses: TomographicImaging/conda-package-publish-action@v2
with:
additional_apt_packages: libgl-dev
subDir: recipe
channels: '-c conda-forge -c ccpi -c paskino'
AnacondaToken: ${{ secrets.ANACONDA_TOKEN }}
publish: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
test_all: ${{(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')) || (github.ref == 'refs/heads/master')}}
convert_win: false
convert_osx: false
7 changes: 4 additions & 3 deletions .github/workflows/docs_build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: docs
on:
release:
types: [published]
Expand All @@ -13,13 +14,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
pre-build-command: python -m pip install --upgrade pip; pip install sphinx_rtd_theme
# Create an artifact of the html output.
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: DocumentationHTML
path: docs/build/html/
Expand All @@ -30,7 +31,7 @@ jobs:
if: github.ref == 'refs/heads/master'
steps:
- name: Download artifact of the html output.
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: DocumentationHTML
path: docs/build/html/
Expand Down
12 changes: 7 additions & 5 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# ChangeLog

## vx.x.x
* Add automatic registration functionality
* Set empty pop-up menus for the main windows
* Set Tabified widgets not to move or close
* Set QDockWidgets flag to NoDockWidgetFeatures to prevent them being moved or lost
* Consume events 'w' and 's' in viewers to avoid render changes between wireframe and surface respectively
* fix some missing pip dependencies & update workflows & fix tests #233
* Edit registration-tab name from "Manual" to "Initial" #241
* Add automatic registration functionality #304
* Set empty pop-up menus for the main windows #217
* Set Tabified widgets not to move or close #226 #217
* Set QDockWidgets flag to NoDockWidgetFeatures to prevent them being moved or lost #226 #217
* Consume events 'w' and 's' in viewers to avoid render changes between wireframe and surface respectively #218
* Added argument parser to idvc command. This allows the user to specify the debugging level
* Add workaround for box clipping due to VTK behaviour change from 9.1. Removed requirement for VTK 8.1.2
* add build directory to gitignore
Expand Down
12 changes: 3 additions & 9 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ source:
path: ../

build:
number: {{ GIT_DESCRIBE_NUMBER }}
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
noarch: python
preserve_egg_dir: False

entry_points:
- idvc = idvc.idvc:main

missing_dso_whitelist:
- /lib64/libc.so.6 # [linux]
- /lib64/libm.so.6 # [linux]
Expand All @@ -23,22 +21,18 @@ build:
- C:\Windows\System32\msvcrt.dll # [win]
- C:\Windows\System32\SHELL32.dll # [win]


test:
source_files:
- ./test

commands:
- python -c "import os; print ('TESTING IN THIS DIRECTORY' , os.getcwd())"
- python -c "import os; print('TESTING IN THIS DIRECTORY', os.getcwd())"
- python -m unittest discover test

requirements:

build:
- python
- numpy
- typing_extensions # [py<=37]

run:
- python
- numpy
Expand Down
24 changes: 17 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

def version2pep440(version):
'''normalises the version from git describe to pep440

https://www.python.org/dev/peps/pep-0440/#id29
'''
if version[0] == 'v':
Expand Down Expand Up @@ -55,12 +55,22 @@ def version2pep440(version):
f.write('version = \'{}\''.format(dversion))

setup(
name = "idvc",
description = 'CCPi DVC Configurator',
version = dversion,
packages = {'idvc', 'idvc.ui', 'idvc.utils'},
package_dir = {'idvc': os.path.join('src','idvc')},
package_data = {'idvc':['DVCIconSquare.png']},
name="idvc",
description='CCPi DVC Configurator',
version=dversion,
packages={'idvc', 'idvc.ui', 'idvc.utils'},
package_dir={'idvc': os.path.join('src','idvc')},
package_data={'idvc':['DVCIconSquare.png']},
install_requires=[
"scipy",
# "ccpi-viewer>=22.2.0", # TODO: put on pypi
"natsort",
"docopt",
"matplotlib",
# "openmp; platform_system=='Darwin'",
"qdarkstyle",
"vtk",
],
# metadata for upload to PyPI
author="Edoardo Pasca, Laura Murgatroyd",
author_email="edo.paskino@gmail.com",
Expand Down
4 changes: 4 additions & 0 deletions src/idvc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@

# Author: Laura Murgatroyd (UKRI-STFC)
# Author: Edoardo Pasca (UKRI-STFC)
try:
import ccpi.viewer
DanicaSTFC marked this conversation as resolved.
Show resolved Hide resolved
except ImportError as exc:
raise ImportError('Please `conda install "ccpi::ccpi-viewer>=22.2.0"`') from exc
6 changes: 3 additions & 3 deletions src/idvc/dvc_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ def setup3DPointCloudPipeline(self):
def CreateRegistrationPanel(self):
"""Create the Registration Dockable Widget"""

self.registration_panel = generateUIDockParameters(self, '2 - Manual Registration')
self.registration_panel = generateUIDockParameters(self, '2 - Initial Registration')
dockWidget = self.registration_panel[0]
dockWidget.setObjectName("RegistrationPanel")
groupBox = self.registration_panel[5]
Expand Down Expand Up @@ -1739,7 +1739,7 @@ def LoadCorrImageForReg(self,resample_corr_image= False, crop_corr_image = False
crop_image=crop_corr_image, origin=origin, target_z_extent=z_extent, finish_fn=self.completeRegistration, output_dir=os.path.abspath(tempfile.tempdir))

def completeRegistration(self):
"""It shows the registration difference volume in the viewer and sets up the tab for the manual registration.
"""It shows the registration difference volume in the viewer and sets up the tab for the registration.
It runs the automatic registration and shows the results and the extra buttons."""
self.manualRegistration()
automatic_reg_worker = Worker(self.automatic_reg_run)
Expand Down Expand Up @@ -1937,7 +1937,7 @@ def reg_viewer_update(self, type = None):
type : str
If 'starting registration' then the registration viewer is centred on the slice that contains point 0.
This is the case if the "Start Registration" button is pressed. Otherwise, when type=None we are in the middle of
manual registration and the viewer is centred on the current slice
registration and the viewer is centred on the current slice
If 'manual registration' then the translation widgets are updated with the current translation on each axis.
If 'automatic registration' then the translation widgets are not updated.
'''
Expand Down