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

AttributeError: 'function' object has no attribute 'im_func' #8

Open
brettsegler opened this issue May 16, 2017 · 8 comments · May be fixed by #10
Open

AttributeError: 'function' object has no attribute 'im_func' #8

brettsegler opened this issue May 16, 2017 · 8 comments · May be fixed by #10

Comments

@brettsegler
Copy link

I can't start a session with pyzos 0.0.8 and Opticstudio 16.5 SP4. I am getting the following respose:

import pyzos.zos as zos
osys = zos.OpticalSystem(sync_ui=True) # enable interactivity with a running UI

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-f53a44b0a298> in <module>()
      1 import pyzos.zos as zos
----> 2 osys = zos.OpticalSystem(sync_ui=True) # enable interactivity with a running UI
      3 

C:\tools\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\pyzos\zos.py in __init__(self, sync_ui, mode)
    292 
    293         ## patch methods from ZOS IOpticalSystem to the wrapped object
--> 294         _replicate_methods(self._iopticalsystem, self)
    295 
    296     # Provide a way to make property calls without the prefix p,

C:\tools\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\pyzos\zosutils.py in replicate_methods(srcObj, dstObj)
     62     for key, value in get_callable_method_dict(srcObj).items():
     63         if key not in overridden_methods:
---> 64             setattr(dstObj, key, zos_wrapper_deco(value))
     65 
     66 def get_properties(zos_obj):

C:\tools\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\pyzos\zosutils.py in zos_wrapper_deco(func)
     55         def wrapper(*args, **kwargs):
     56             return wrapped_zos_object(func(*args, **kwargs))
---> 57         varnames = func.im_func.func_code.co_varnames # alternative is to use inspect.getargspec
     58         params = [par for par in varnames if par not in ('self', 'ret')] # removes 'self' and 'ret'
     59         wrapper.__doc__ = func.im_func.func_name + '(' + ', '.join(params) + ')'

AttributeError: 'function' object has no attribute 'im_func'
@indranilsinharoy
Copy link
Collaborator

Hi @brettsegler,
I'm not actively developing this project any more (mostly because of the lack of interest). However, I'll try to look into this issue during the weekend (I can't promise though). I'm really sorry.

@JohnDGriffith
Copy link

I'm having the same problem. I guess that I will go back to pyZDDE

@indranilsinharoy
Copy link
Collaborator

@JohnDGriffith, I am really sorry that I'm currently not being able to fix these problems. I have been very busy for the last several months. I am actually surprised that some people have/are trying PyZOS! I'm really sorry, if I wasted any of your time.

@JohnDGriffith
Copy link

JohnDGriffith commented Jun 15, 2017 via email

@indranilsinharoy
Copy link
Collaborator

@JohnDGriffith "If Zemax does remove the DDE interface, could we contract with you to work on the pyzos module?"
Absolutely!

@JohnDGriffith
Copy link

JohnDGriffith commented Jun 16, 2017 via email

@brettsegler
Copy link
Author

I am working with the ZOS-API like documented by ZEMAX for now. PyZos would be a great help. Finding the documentation for the functions is tedious. So I am very interested as well in any further development.

@indranilsinharoy
Copy link
Collaborator

@brettsegler Thank you. I am currently in a career transition period. I hope that will be able to further develop PyZOS in the near future.

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 a pull request may close this issue.

3 participants