ElectricityLCI icon indicating copy to clipboard operation
ElectricityLCI copied to clipboard

Update olca-ipc calls to use 0.12

Open m-jamieson opened this issue 1 year ago • 5 comments

Fedelemflowlist and lciafmt are both requiring olca-ipc >= 0.12. Our current requirement is locked at 0.10. Updates need to be made to resolve conflicts, and I suppose stay with the times.

m-jamieson avatar Mar 09 '23 14:03 m-jamieson

I received the following error after running the development branch of eLCI, which includes olca-ipc-0.0.12:

Traceback (most recent call last):
  File "main.py", line 147, in <module>
    main()
  File "main.py", line 31, in main
    upstream_dict = electricitylci.write_upstream_dicts_to_jsonld(upstream_dict)
  File "~/Repositories/usepa/ElectricityLCI/electricitylci/__init__.py", line 346, in write_upstream_dicts_to_jsonld
    upstream_dicts = write_process_dicts_to_jsonld(upstream_dicts)
  File "~/Repositories/usepa/ElectricityLCI/electricitylci/__init__.py", line 279, in write_process_dicts_to_jsonld
    from electricitylci.olca_jsonld_writer import write
  File "~/Repositories/usepa/ElectricityLCI/electricitylci/olca_jsonld_writer.py", line 405, in <module>
    def _process_ref(dict_d: dict) -> Optional[olca.ProcessRef]:
AttributeError: module 'olca' has no attribute 'ProcessRef'

This drums up a memory of version issues I ran in before. I'll try installing 0.0.10 and re-running.

dt-woods avatar Mar 16 '23 22:03 dt-woods

Version 0.0.10 of olca-ipc does not solve the problem. Ran into this instead:

Traceback (most recent call last):
  File "main.py", line 147, in <module>
    main()
  File "main.py", line 31, in main
    upstream_dict = electricitylci.write_upstream_dicts_to_jsonld(upstream_dict)
  File "~/Repositories/usepa/ElectricityLCI/electricitylci/__init__.py", line 346, in write_upstream_dicts_to_jsonld
    upstream_dicts = write_process_dicts_to_jsonld(upstream_dicts)
  File "~/Repositories/usepa/ElectricityLCI/electricitylci/__init__.py", line 284, in write_process_dicts_to_jsonld
    olca_dicts = write(all_process_dicts, config.model_specs.namestr)
  File "~/Repositories/usepa/ElectricityLCI/electricitylci/olca_jsonld_writer.py", line 43, in write
    _process_dq(d_vals, process)
  File "~/Repositories/usepa/ElectricityLCI/electricitylci/olca_jsonld_writer.py", line 67, in _process_dq
    process.dq_system = olca.ref(olca.DQSystem, pdq_uid)
AttributeError: module 'olca' has no attribute 'DQSystem'

dt-woods avatar Mar 16 '23 22:03 dt-woods

Digging between versions 0.0.10 and 0.0.12, it looks like olca-ipc has changed the language of ProcessRef to just Ref. That might be the fix that's needed!

dt-woods avatar Mar 20 '23 16:03 dt-woods

FYI olca-schema has been split out from olca-ipc. The olca-schema is primarily used for writing json and may be sufficient for eLCI purposes. We will be switching to requiring olca-schema >= v0.0.11 soon.

This all relates to use with openLCA 2.0

bl-young avatar Aug 03 '23 18:08 bl-young

Current development is underway to update all the references to olca-schema classes and the new zipio reader/writer.

dt-woods avatar Aug 04 '23 15:08 dt-woods