Comments (10)
Stuff To fix:
camfr/camfr_wrap.cpp:580:3: error: void function 'init_module__camfr' should not return a
value [-Wreturn-type]
import_array();
^~~~~~~~~~~~~~
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:1547:144: note:
expanded from macro 'import_array'
..."numpy.core.multiarray failed to import"); return NUMPY_IMPORT_ARRAY_RETVAL; } }
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
See these links for fixes:
pandas-dev/pandas#3872
tensorflow/tensorflow#733
Googled : https://www.google.com/search?client=safari&rls=en&q=%22should+not+return+a+value%22+return+NUMPY_IMPORT_ARRAY_RETVAL&ie=UTF-8&oe=UTF-8
from camfr.
Trying this on this branch: https://github.com/demisjohn/CAMFR/tree/py35_compat
from camfr.
After fixing "TabErrors", compiling (and failing due to above numpy issue), ahve a bunch of indentation errors!
Numerous def
and if
statements are now incorrectly indented.
Some of those might only pop errors when the functions are executed during usage, not during compilation...
byte-compiling visualisation/camfr_PIL.py to camfr_PIL.cpython-35.pyc
Sorry: IndentationError: expected an indented block (camfr_PIL.py, line 672)
byte-compiling visualisation/camfr_matlab.py to camfr_matlab.cpython-35.pyc
Sorry: IndentationError: expected an indented block (camfr_matlab.py, line 203)
byte-compiling visualisation/camfr_tk.py to camfr_tk.cpython-35.pyc
Sorry: IndentationError: expected an indented block (camfr_tk.py, line 312)
byte-compiling visualisation/TkPlotCanvas.py to TkPlotCanvas.cpython-35.pyc
Sorry: IndentationError: expected an indented block (TkPlotCanvas.py, line 187)
Looks like the original files will randomly switch between using Tabs
and four-spaces
, even within a single function. Sounds like Py27 graciously glossed this over, but this is now an error in py3.x
from camfr.
@demisjohn: Run 'diff' on py35 and py27 source files, look for indentation mistakes (I may have introduced some)
Do the diff in GitHub:
https://stackoverflow.com/questions/43552274/how-can-i-diff-two-branches-in-github
Here's the diff link:
master...demisjohn:py35_compat
from camfr.
Corrected indentations to match old master version, in 7e1224c
Some of the loops and function defs had been incorrectly indented, hopefully they are fixed. Have NOT yet run tests to confirm they're all ok.
from camfr.
Regarding numpy error, it seems that, new in Python3, numpy's C library returns an int
whereas it used to return void
. This is supposedly ocurring in the camfrwrap.cpp
file, where it creates some sort of wrapper/pointer to the numpy C code (?). Some suggestions were to add a conditional into the wrap.cpp file that defines our func as void/int depending on whether it's being compiled for py2x/py3x.
I suppose it would be good for the library to be cross-compatible with python2/3, but I am heavily leaning towards just dropping support for 2.x entirely.
Let me know if there's some pressing reason we should still support python 2.x.
from camfr.
Don't see any real reason on maintaining Python 2.x support.
Maybe do a final 2.x-compatible release, and then drop 2.x?
from camfr.
Online articles indicate that one should really just move to Python3.x, so i will try to do that.
from camfr.
Good idea @kitchenknif , I'll make a "release" for py2.x and call it done. May keep py2.7 alive for a short while longer as I try to get actual work done with CAMFR before the py3.x version is actually working.
from camfr.
just to keep track on this issue about the last changes for CAMFR users:
- the patches here: #21 now integrated in the branch are fixing the remaining python issues and configuration issues - and tested on MBP M1 macOS with Python 3.9
- the patches here: #22 to be integrated in the branch are fixing pre-existing issues in C code - mainly related to boundary checking in different algorithms, and fix use of numpy deprecated functions
one single test unit is not passing:
======================================================================
FAIL: testbackward (__main__.backward)
backward
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/senellart/DEV/3rdParty/CAMFR/testsuite/backward.py", line 48, in testbackward
self.assertTrue(R_pass and T_pass)
AssertionError: False is not true
----------------------------------------------------------------------
I will complete with additional cleanup on setup.py - on from if the last test unit passes, from my perspective, this branch will be fully functional.
from camfr.
Related Issues (19)
- camfr_PIL.py HOT 4
- Write INSTALL.MacOS instructions using MacPorts HOT 2
- SegFault on passing Section object HOT 2
- Need Python documentation for Boost (C) objects HOT 3
- Upgrade to Matplotlib-based plotting HOT 6
- setup.py should build the Docs PDF manual
- TO DO file text
- make camfr.pdf documentation in setup.py HOT 1
- ImportError: No module named _camfr HOT 1
- Installation HOT 3
- Installation HOT 1
- Python 3 support HOT 1
- segmentation fault with class constructors HOT 2
- Merge demisjohn fork/transfer ownership HOT 6
- Create statically-linked version for MacOS Installer HOT 1
- Make Machine_cfg.py that compiles on MacOS HOT 2
- Automatically rename `_camfr.dylib` to `_camfr.so`
- remove global imports of `numpy` etc. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from camfr.