-
Notifications
You must be signed in to change notification settings - Fork 1.1k
spa_c_files don't build with VC14 (Python 3.5) #168
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
Comments
It's been a long time since I used spa_c, and I don't have any experience with Visual Studio, so I don't have any hints for you there. However, I'll point out that the benchmarks in #48 show that spa_python+numpy and spa_c are essentially the same speed, and spa_python+numba is significantly faster than spa_c. As with many benchmarks, your mileage may vary. |
@mikofski ok to close this? while it may still be a bug with pvlib it may now be irrelevant after 2 years of default tooling changes |
No I'm still looking into it, I just ran it again in a fresh Python-3.7 environment, and I still get the exact same error, so no I don't think we should close it just yet, b/c we need to consider if we want to include One thing, we can definitely delete the |
Thanks for checking Mark. I'd be happy to see it move to another repository. We could still keep the wrapper option in I believe we include |
I don't think that works, that file I just compiled >cl /Fobuild\ /Febuild\spa_tester.exe spa.c spa_tester.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26726 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
spa.c
spa_tester.c
Generating Code...
Microsoft (R) Incremental Linker Version 14.15.26726.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:build\spa_tester.exe
build\spa.obj
build\spa_tester.obj
>build\spa_tester.exe
Julian Day: 2452930.312847
L: 2.401826e+01 degrees
B: -1.011219e-04 degrees
R: 0.996542 AU
H: 11.105902 degrees
Delta Psi: -3.998404e-03 degrees
Delta Epsilon: 1.666568e-03 degrees
Epsilon: 23.440465 degrees
Zenith: 50.111622 degrees
Azimuth: 194.340241 degrees
Incidence: 25.187000 degrees
Sunrise: 06:12:43 Local Time
Sunset: 17:20:19 Local Time so I think the issue is in the supporting Cython code: |
It was supposed to work like this from the cython docs. Maybe the upcoming SSC release will make this wrapper pointless. I say we continue to ignore it for now. |
OK, I figured it out, but I'll never understand why. For some reason, Cython does not like the keyword Replacing |
How did you find that??? Do you want to sneak this into 0.6.0? I'm going to let #575 sit until tomorrow. |
* closes pvlib#168 * get source and header in setup.py * replace "timezone" with "timezone" to fix the bug * also update readme * also remove a lot of extra whitespace and tabs Signed-off-by: Mark Mikofski <[email protected]>
|
take your word on it
ok with me, but update the readme in that subpackage accordingly. |
here's the test output, LGTM: >>> spa_calc(year=2004, month=10, day=17, hour=12, minute=30, second=30, time_zone=-7, longitude=-105.1786, latitude=39.742476, elevation=1830.14, pressure=820, temperature=11, delta_t=67)
{'year': 2004,
'month': 10,
'day': 17,
'hour': 12,
'minute': 30,
'second': 30.0,
'delta_ut1': 0.0,
'delta_t': 67.0,
'time_zone': -7.0,
'longitude': -105.1786,
'latitude': 39.742476,
'elevation': 1830.14,
'pressure': 820.0,
'temperature': 11.0,
'slope': 30.0,
'azm_rotation': -10.0,
'atmos_refract': 0.5667,
'function': -1984328928,
'e0': 39.59209464796398,
'e': 39.60858878898177,
'zenith': 50.39141121101823,
'azimuth_astro': 14.311961805946808,
'azimuth': 194.3119618059468,
'incidence': 6.95264798328736e-310,
'suntransit': 8.648152507504e-312,
'sunrise': 1.6578093e-316,
'sunset': 2.67e-322} |
* git rm spa_py.c to remove it from repo * add cython to option extra requires * use full paths in spa_c_files for sources * add line to bug fixes addressing pvlib#168
* BUG: ENH: update spa_files to patch timezone bug * closes #168 * get source and header in setup.py * replace "timezone" with "timezone" to fix the bug * also update readme * also remove a lot of extra whitespace and tabs Signed-off-by: Mark Mikofski <[email protected]> * ENH: add no Python-2.7 to spa_c_files README * add enumeration for function type, it was reading garbage, so you never new exacton which calculations SPA was doing, and you would get garbage values for incidence, sunrise, transit, and sunset times * set function SPA_ALL, and pass extra args in as optional keyword args for slope, delta_ut1, azm_rotation, and atmos_refract * add example file that user can run to test build * ENH: mention test exampleg, fix azm_rotation typo * ENH: fix link, force reader to accept license, wrap long lines, update email, (c) * ENH: ask user for their name, fail ungracefully * ENH: get all information to submit to DOE * use timezone as arg, change output to timezone * add comment about __timezone macro, use consistent API in spa_calc for args and returns * oops accidently deleted spa_py.c * ENH: ignore cython generated spa_py.c file * git rm spa_py.c to remove it from repo * add cython to option extra requires * use full paths in spa_c_files for sources * add line to bug fixes addressing #168 * remove autodownload, revert readme * with the function * respond to comments * explain that timezone is replaced with time_zone in spa_c docstring to avoid nameclash due to Python bug 24643 * explain why time_zone column renamed to timezone to match caller API * Copy the comment from solarposition.py * that explains that we replace timezone with time_zone at build * Python>=3.5 * wrap long lines
Nevermind, found it :) |
windows 7 amd64
Cython (0.24)
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32
if I try to build spa_c for Python-3.5 I get the following:
The text was updated successfully, but these errors were encountered: