Skip to content

Commit

Permalink
Updated make_upload.sh to include Python 3.9 versions for macOS (x64).
Browse files Browse the repository at this point in the history
  • Loading branch information
perwin committed Jan 2, 2021
1 parent fe9bb7f commit 33f02c3
Show file tree
Hide file tree
Showing 6 changed files with 405 additions and 1,208 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# This GitHub Actions workflow will install Python dependencies and run tests for PyImfit
# with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: PyImfit
Expand Down
4 changes: 2 additions & 2 deletions howto_new_distribution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Working by default in ~/coding/pyimfit on Mac.
F. [mac] cp ~/vagrant/ubuntu64-16_dev/transfer/libimfit.a ./prebuilt/linux64

3. Do new "develop" install and run tests on macOS
[mac] $ python3 setup.py develop
[mac] $ pip3 install -e ./
[mac] $ cd pyimfit/tests ; pytest

4. Do new "develop" install and run tests on Linux VM
[mac] $ cd ~/vagrant/ubuntu64-16_dev/transfer
[mac] $ git clone ~/coding/pyimfit pyimfit
[vm] $ cd /vagrant/transfer/pyimfit
[vm] $ python3 setup.py develop --user
[vm] $ pip3 install --user -e ./
[vm] $ cd pyimfit/tests ; pytest

5. Update version number in pyimfit/__init__.py
Expand Down
5 changes: 4 additions & 1 deletion make_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ if [[ $# -ne 1 ]]; then
fi

# Make sdist (.tar.gz) and macOS binary wheels
python3.8 setup.py sdist bdist_wheel
python3.9 setup.py sdist bdist_wheel
python3.8 setup.py bdist_wheel
python3.7 setup.py bdist_wheel
python3.6 setup.py bdist_wheel
# Copy shared libs into wheel using delocate
VERSION_NUM=$1
cd dist
delocate-wheel -w fixed_wheels -v pyimfit-${VERSION_NUM}-cp39-cp39-macosx_10_9_x86_64.whl
delocate-wheel -w fixed_wheels -v pyimfit-${VERSION_NUM}-cp38-cp38-macosx_10_9_x86_64.whl
delocate-wheel -w fixed_wheels -v pyimfit-${VERSION_NUM}-cp37-cp37m-macosx_10_9_x86_64.whl
delocate-wheel -w fixed_wheels -v pyimfit-${VERSION_NUM}-cp36-cp36m-macosx_10_9_x86_64.whl
Expand All @@ -25,3 +27,4 @@ python3 -m twine upload dist/pyimfit-${VERSION_NUM}.tar.gz
python3 -m twine upload dist/fixed_wheels/pyimfit-${VERSION_NUM}-cp36-cp36m-macosx_10_9_x86_64.whl
python3 -m twine upload dist/fixed_wheels/pyimfit-${VERSION_NUM}-cp37-cp37m-macosx_10_9_x86_64.whl
python3 -m twine upload dist/fixed_wheels/pyimfit-${VERSION_NUM}-cp38-cp38-macosx_10_9_x86_64.whl
python3 -m twine upload dist/fixed_wheels/pyimfit-${VERSION_NUM}-cp39-cp39-macosx_10_9_x86_64.whl
34 changes: 29 additions & 5 deletions new_notes_and_todo_for_python-wrapper_code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PLAN:
[X] Update imfit_lib.pxd to handle changed AddFunctions
[X] Update pyimfit_lib.pyx to handle changed AddFunctions

[ ] Update Python code to handle changed AddFunctions
[X] Update Python code to handle changed AddFunctions
-- e.g., pass in labels when initializing FunctionDescription objects?
[x] Update code in descriptions.py
[x] Update code that reads in config files to check for and add
Expand All @@ -39,7 +39,7 @@ PLAN:
[ ] Build and test pyimfit on Linux VM
-- howto_new_distribution.txt
[X] Find notes on building on Linux VM
[ ] Build new libimfit.a on Linux VM
[X] Build new libimfit.a on Linux VM
-- [opt]2. Generate updated libimfit.a for Linux [VM: ubuntu64-16_dev], IF NECESSARY


Expand All @@ -50,9 +50,11 @@ PLAN:
** New Update: Make build for Python 3.9
howto_new_distribution.txt

[ ] Install Python 3.9
[ ] Install Python 3.9
[ ] Install necessary libraries via pip
[X] Install Python 3.9
[X] Install Python 3.9
[X] Install necessary libraries via pip

[ ] Add Python 3.9 as an option for GitHub Actions testing workflow

[ ] Upload new version to pip staging area

Expand All @@ -64,6 +66,28 @@ PLAN:
** Alternate outputs for best-fit parameter values
https://github.com/perwin/pyimfit/issues/2

[ ] Brainstorm alternate output
-- return ModelDescription object
-- return list of single-function-set dicts
OR: return dict containing single-function-set dicts, so we can optionally
have labels for each function set as the keys (e.g., corresponding to FunctionSetDescription.name)
Note that ModelObject stores its function sets as as List[FunctionSetDescription]

Possible outline for model-as-dict
optionsDict
dict_of_function_sets -- OrderedDict
'funcset-name': function-set-dict

function-set-dict -- OrderedDict
optional name [--> FunctionSetDescription.name]
list or OrderedDict of functions

funtion-dict -- OrderedDict
function name ("Exponential", etc.)
optional label
parameter-name: parameter-value




* Packaging:
Expand Down
1 change: 1 addition & 0 deletions pyimfit/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ def loadData(self, image, error=None, mask=None, **kwargs ):
if isinstance(error, np.ma.MaskedArray):
error = error.filled(fill_value=error.max())

# Note that the following will call _modelObjectWrapper.doFinalSetup()
self._modelObjectWrapper.loadData(image, error, mask, **kwargs)
self._dataSet = True

Expand Down

0 comments on commit 33f02c3

Please sign in to comment.