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

Having issues getting isotherms into pygaps, aif import fails #55

Open
a11enh opened this issue Sep 6, 2024 · 0 comments
Open

Having issues getting isotherms into pygaps, aif import fails #55

a11enh opened this issue Sep 6, 2024 · 0 comments
Labels

Comments

@a11enh
Copy link

a11enh commented Sep 6, 2024

Describe the bug
Done in jupyter lab: using import_from_aif from a converted to .aif format (from quantachrome via the online web-aif converter) - fails on import due to string parsing?

To Reproduce

import pygaps.parsing as pgp
isotherm = pgp.isotherm_from_aif('MySample1.aif')

Errors reported:

FutureWarning: errors='ignore' is deprecated and will raise in a future version. Use to_numeric without passing `errors` and catch exceptions explicitly instead
  ).apply(pandas.to_numeric, errors='ignore')
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[4], line 3
      1 import pygaps.parsing as pgp
----> 3 isotherm = pgp.isotherm_from_aif('MySample1.aif')

File [~\AppData\Local\anaconda3\Lib\site-packages\pygaps\parsing\aif.py:350](http://localhost:8888/lab/tree/Desktop/~/AppData/Local/anaconda3/Lib/site-packages/pygaps/parsing/aif.py#line=349), in isotherm_from_aif(str_or_path, **isotherm_parameters)
    348 # loading/material units
    349 loading_material_units = block.find_value('_units_loading').strip("'")
--> 350 loading_material_dict = parse_loading_string(loading_material_units)
    351 raw_dict.update(loading_material_dict)
    353 # temperature units

File [~\AppData\Local\anaconda3\Lib\site-packages\adsorption_file_parser\utils\unit_parsing.py:199](http://localhost:8888/lab/tree/Desktop/~/AppData/Local/anaconda3/Lib/site-packages/adsorption_file_parser/utils/unit_parsing.py#line=198), in parse_loading_string(loading_string, missing_units)
    197 if len(unit_components) != 2:
    198     unit_components = loading_string_clean.split(' ')
--> 199     unit_components[1] = unit_components[1].replace('-1', '')
    200 if len(unit_components) != 2:
    201     raise ParsingError(error_text)

IndexError: list index out of range

Expected behavior
pygaps importer would have imported loading units appropriately... from the .aif the header info is:

data_raw2aif _exptl_operator 'User1' _exptl_date 2024-08-23T00:00:00 _exptl_instrument 'Autosorb iQ Station 2' _exptl_adsorptive 'Nitrogen' _exptl_temperature 77.35 _adsnt_sample_mass 0.0717 _adsnt_sample_id 'sample1' _adsnt_material_id 'unknown' _units_temperature 'K' _units_pressure 'Torr' _units_mass 'g' _units_loading 'cc' _audit_aif_version d546195

System (please complete the following information):

  • Windows 11, Anaconda
  • Python 3.11.9 64-bit
  • Conda 24.7.1

Additional context
Had issues manually creating point-isotherms from data, but further work I think will make it work... coming at this from a few different directions... trying to compare multiple machines (Nova, Quantachrome, Micromeritics)

Where you are from?/How are you using pyGAPS? (optional)
Researcher at Univ. Of IL working on graphene-like carbons

@a11enh a11enh added the bug label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant