Translator Errors

33 views
Skip to first unread message

wesley tatum

unread,
Jul 19, 2018, 6:34:50 PM7/19/18
to pycroscopy
I’m having some trouble with the translators again. I am trying to use both the pycroscopy.io.BrukerAFMTranslator() and pycroscopy.io.IgorIBWTranslator() classes. Both are giving me the same error when I try to access filepaths. The error path seems to say that the type error is in the classes, and not a file path issue:

“”"
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-6324c9de29f3> in <module>()
----> 1 test = px.io.BrukerAFMTranslator(filepath[1])

~/miniconda3/lib/python3.6/site-packages/pycroscopy/core/io/translator.py in __init__(self, max_mem_mb, *args, **kwargs)
    31         Translator object
    32         “”"
---> 33         self.max_ram = min(max_mem_mb * 1024 ** 2, 0.75 * get_available_memory())
    34
    35     @abc.abstractmethod

TypeError: ‘<’ not supported between instances of ‘float’ and ‘str’
“”"

Chris Smith

unread,
Jul 20, 2018, 8:31:14 AM7/20/18
to pycroscopy
Wes,

I see your problem.  You shouldn't send the file path when you initialize the translator.  The only argument you need is the maximum memory you want the translation to use.  You will supply the file_path when you call test.translate.

Chris Smith

wesley tatum

unread,
Jul 20, 2018, 6:34:57 PM7/20/18
to pycroscopy
That fixed that problem, thank you!
Reply all
Reply to author
Forward
0 new messages