patnr / historymatching Goto Github PK
View Code? Open in Web Editor NEWNotebooks on production optimisation and history matching
License: MIT License
Notebooks on production optimisation and history matching
License: MIT License
I'm trying to use this file in my own enviroment. I've set up the enviroment, installed the requirements.txt and have opened it up in jupyter notebook just as the README suggests but when I run the code, its holding up just after the forward model process. The line that it's crashing at is
(wsat.past.Prior,
prod.past.Prior) = forward_model(nTime, wsat.init.Prior, perm.Prior)
The error message I'm receiving is
RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
"""
Traceback (most recent call last):
File "C:**\Anaconda3\lib\site-packages\multiprocess\pool.py", line 125, in worker
result = (True, func(args, **kwds))
File "C:*\Anaconda3\lib\site-packages\pathos\helpers\mp_helper.py", line 15, in
func = lambda args: f(args)
File "C:*\AppData\Local\Temp\ipykernel_4264\2723154157.py", line 10, in run1
NameError: name 'copy' is not defined
"""
The above exception was the direct cause of the following exception:
NameError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_4264\682821882.py in
1 (wsat.past.Prior,
----> 2 prod.past.Prior) = forward_model(nTime, wsat.init.Prior, perm.Prior)
~\AppData\Local\Temp\ipykernel_4264\2723154157.py in forward_model(nTime, *variables, **kwargs)
31
32 # Dispatch jobs
---> 33 Ef = mp(run1, E, total=len(variables[0]),
34 desc="Ens-run"+kwargs.get("desc", ""), leave=kwargs.get("leave", True))
35
~**\Documents\HistoryMatching-master\tools\utils.py in mp(fun, args, desc, total, leave)
155
156 from p_tqdm import p_map
--> 157 return p_map(fun, list(args), desc=desc, num_cpus=nCores, leave=leave)
158 else:
159 return progbar(map(fun, args), desc=desc, total=total, leave=leave)
~\Anaconda3\lib\site-packages\p_tqdm\p_tqdm.py in p_map(function, *iterables, **kwargs)
63 ordered = True
64 generator = _parallel(ordered, function, *iterables, **kwargs)
---> 65 result = list(generator)
66
67 return result
~\Anaconda3\lib\site-packages\p_tqdm\p_tqdm.py in _parallel(ordered, function, *iterables, **kwargs)
52 tqdm_func = kwargs.pop('tqdm', tqdm)
53
---> 54 for item in tqdm_func(map_func(function, *iterables), total=length, **kwargs):
55 yield item
56
~\Anaconda3\lib\site-packages\tqdm\notebook.py in iter(self)
252 try:
253 it = super(tqdm_notebook, self).iter()
--> 254 for obj in it:
255 # return super(tqdm...) will not catch exception
256 yield obj
~\Anaconda3\lib\site-packages\tqdm\std.py in iter(self)
1176
1177 try:
-> 1178 for obj in iterable:
1179 yield obj
1180 # Update and possibly print the progressbar.
~\Anaconda3\lib\site-packages\multiprocess\pool.py in next(self, timeout)
868 if success:
869 return value
--> 870 raise value
871
872 next = next # XXX
NameError: name 'copy' is not defined
I;ve also ran the MAIN python file in VS Code and ran the debugger and it's resulting in an error in the utils.py file on line 157.
return p_map(fun, list(args), desc=desc, num_cpus=nCores, leave=leave)
Exception has occurred: RuntimeError (note: full exception trace is shown but execution is paused at: )
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
File "C:**\Documents\HistoryMatching-master\tools\utils.py", line 157, in mp
return p_map(fun, list(args), desc=desc, num_cpus=nCores, leave=leave)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:**\Documents\HistoryMatching-master\MAIN.py", line 408, in forward_model
Ef = mp(run1, E, total=len(variables[0]),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:**\Documents\HistoryMatching-master\MAIN.py", line 441, in
prod.past.Prior) = forward_model(nTime, wsat.init.Prior, perm.Prior)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1, in (Current frame)
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
I'm not sure why this result is happening because I followed all the steps to run the code on my own server. Any help would be great.
ValueError Traceback (most recent call last)
Cell In[43], line 2
1 wsat0 = np.zeros(model.Nxy)
----> 2 wsat.past.Truth = model.sim(dt, nTime, wsat0, implicit=False)
3 prod.past.Truth = np.array([obs_model(x) for x in wsat.past.Truth[1:]])
File ~/.local/lib/python3.10/site-packages/TPFA_ResSim/init.py:345, in ResSim.sim(self, dt, nSteps, x0, pbar, leave, **kwargs)
343 kk = tqdm(kk, "Simulation", leave=leave, mininterval=1e-2)
344 for k in kk:
--> 345 xx[k+1] = step(xx[k], k)
346 return xx
File ~/.local/lib/python3.10/site-packages/TPFA_ResSim/init.py:320, in ResSim.time_stepper..integrate(S, k)
318 S = self.saturation_step_implicit(S, V, dt)
319 else:
--> 320 S = self.saturation_step_upwind(S, V, dt)
321 return S
File ~/.local/lib/python3.10/site-packages/TPFA_ResSim/init.py:249, in ResSim.saturation_step_upwind(self, S, V, dt)
247 # Compute sub/local dt
248 cfl = self.estimate_CFL(pv, V, fi)
--> 249 nT = int(np.ceil(dt / cfl))
250 nT = max(1, nT)
252 # Scale A
ValueError: cannot convert float NaN to integer
Error while trying to simulate model wsat.past.Truth, trying to set the implicit to true but it wont converge for some reasons
Hi,
any plans on releasing the code for struct_tools
?
The objects in struct_tools
seem simple enough, but cause a bit of friction due to lack of documentation and / or code.
Thanks
D. Oliver pointed out that water cut should not be confused with water saturation (at the well location, e.g.). Either fix naming, or definitions of observations (see email).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.