def test_fit_initial_guess(self, reservoir_simulation_data, primary, tau_selection, constraints): injection, production, time = reservoir_simulation_data crm = CRM(primary, tau_selection, constraints) crm.set_rates(production, injection, time) x0 = crm._get_initial_guess(tau_selection) for random in (True, False): crm.fit(production, injection, time, random=random, initial_guess=x0, options={'maxiter': 100})
def test_fit_fails(self, reservoir_simulation_data, primary, tau_selection, constraints): crm = CRM(primary, tau_selection, constraints) injection, production, time = reservoir_simulation_data with pytest.raises(TypeError): crm.fit(production) with pytest.raises(TypeError): crm.fit(production, injection) with pytest.raises(ValueError): crm.fit(production[:-1], injection, time) with pytest.raises(ValueError): crm.fit(production, injection[:-1], time) with pytest.raises(ValueError): crm.fit( production, injection, time[:-1], )
def test_fit_parallel(self, reservoir_simulation_data, primary, tau_selection, constraints): injection, production, time = reservoir_simulation_data crm = CRM(primary, tau_selection, constraints) crm.fit(production, injection, time, num_cores=4)