sinanozaydin / pide

A python library for petrophysical calculations.
https://pide.readthedocs.io/
GNU General Public License v3.0
5 stars 2 forks source link

JOSS Review: Example Notebook `9_2D_Underworld_Conversion.ipynb` #6

Closed kujaku11 closed 3 days ago

kujaku11 commented 3 months ago

Running Jupyter notebook examples/9_2D_Underworld_Conversion.ipynb produces the following error in block 10. [Using pip install --> v0.3 and notebooks from main branch]

---------------------------------------------------------------------------
RemoteTraceback                           Traceback (most recent call last)
RemoteTraceback: 
"""
Traceback (most recent call last):
  File "[\Anaconda3\envs\pide\lib\multiprocessing\pool.py", line 125](file:///Anaconda3/envs/pide/lib/multiprocessing/pool.py#line=124), in worker
    result = (True, func(*args, **kwds))
  File "[\Anaconda3\envs\pide\lib\multiprocessing\pool.py", line 48](file://Anaconda3/envs/pide/lib/multiprocessing/pool.py#line=47), in mapstar
    return list(map(*args))
  File "[\Anaconda3\envs\pide\lib\site-packages\pide\model.py", line 141](file://Anaconda3/envs/pide/lib/site-packages/pide/model.py#line=140), in run_model
    pide_object.set_mineral_conductivity_choice(ol = material.el_cond_selections['ol'],
  File "[\Anaconda3\envs\pide\lib\site-packages\pide\pide.py", line 1432](file://Anaconda3/envs/pide/lib/site-packages/pide/pide.py#line=1431), in set_mineral_conductivity_choice
    self._mineral_conductivity_choice_check()
  File "[\Anaconda3\envs\pide\lib\site-packages\pide\pide.py", line 1445](file://Anaconda3/envs/pide/lib/site-packages/pide/pide.py#line=1444), in _mineral_conductivity_choice_check
    if (pide.minerals_cond_selections[i] < 0) or (pide.minerals_cond_selections[i] > len(self.name[mineral_idx[i]])):
AttributeError: 'pide' object has no attribute 'name'
"""

The above exception was the direct cause of the following exception:

AttributeError                            Traceback (most recent call last)
Cell In[10], line 4
      1 #creating model_object
      2 mt_model_object = Model(material_list = material_object_list, material_array = material_array, material_list_2 = material_object_list_2, T = temp_array, P = pressure_array, model_type = 'underworld_2d', melt = melt_array,
      3 p_strain = pstrain_array, material_node_skip_rate_list = material_skip_list)
----> 4 backgr_cond = mt_model_object.calculate_model(type = 'conductivity', num_cpu = 5)

File [~\Anaconda3\envs\pide\lib\site-packages\pide\model.py:457](http://localhost:8888/lab/tree/pide/examples/notebooks/~/Anaconda3/envs/pide/lib/site-packages/pide/model.py#line=456), in Model.calculate_model(self, type, num_cpu)
    452 with multiprocessing.Pool(processes=num_cpu) as pool:
    454     process_item_partial = partial(run_model, material =  material_list_holder[l][i], pide_object = mat_pide_obj, t_array = self.T,
    455     p_array = self.P, melt_array = self.melt_frac, type = type)
--> 457     c = pool.map(process_item_partial, sliced_material_idx)
    459 #assigning to the global cond list
    460 for idx in range(0,len(sliced_material_idx)):

File [~\Anaconda3\envs\pide\lib\multiprocessing\pool.py:364](http://localhost:8888/lab/tree/pide/examples/notebooks/~/Anaconda3/envs/pide/lib/multiprocessing/pool.py#line=363), in Pool.map(self, func, iterable, chunksize)
    359 def map(self, func, iterable, chunksize=None):
    360     '''
    361     Apply `func` to each element in `iterable`, collecting the results
    362     in a list that is returned.
    363     '''
--> 364     return self._map_async(func, iterable, mapstar, chunksize).get()

File [~\Anaconda3\envs\pide\lib\multiprocessing\pool.py:771](http://localhost:8888/lab/tree/pide/examples/notebooks/~/Anaconda3/envs/pide/lib/multiprocessing/pool.py#line=770), in ApplyResult.get(self, timeout)
    769     return self._value
    770 else:
--> 771     raise self._value

AttributeError: 'pide' object has no attribute 'name'
sinanozaydin commented 1 month ago

The issues should be resolved in the latest version at the github repo (post-joss branch).

kujaku11 commented 3 days ago

@sinanozaydin works with post-joss branch.