AGBV / YASF

Yet Another Scattering Framework python implementation
https://agbv.github.io/YASF/
MIT License
0 stars 0 forks source link

Reading refractive indices from eodg doesn't work #1

Closed aetherspritee closed 8 months ago

aetherspritee commented 8 months ago

Conversion to pandas dataframe doesn't work correctly:

Traceback (most recent call last):
  File "/Users/dusc/Code/YASF_test/lpsc_2023.py", line 31, in <module>
    materials = Particles.generate_refractive_index_table(urls)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dusc/venv/lib/python3.11/site-packages/yasfpy/particles.py", line 39, in generate_refractive_index_table
    data[k] = material_handler(url)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dusc/venv/lib/python3.11/site-packages/yasfpy/functions/misc.py", line 207, in material_handler
    data["ref_idx"] = pd.concat([data["ref_idx"], df])
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dusc/venv/lib/python3.11/site-packages/pandas/util/_decorators.py", line 331, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dusc/venv/lib/python3.11/site-packages/pandas/core/reshape/concat.py", line 368, in concat
    op = _Concatenator(
         ^^^^^^^^^^^^^^
  File "/Users/dusc/venv/lib/python3.11/site-packages/pandas/core/reshape/concat.py", line 458, in __init__
    raise TypeError(msg)
TypeError: cannot concatenate object of type '<class 'str'>'; only Series and DataFrame objs are valid