Git Product home page Git Product logo

ccd_tools's Introduction

Hi there ๐Ÿ‘‹

ccd_tools's People

Contributors

gitter-badger avatar limbrock avatar m-weigand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ccd_tools's Issues

add jupyter examples

It would be nice to provide read-to-use jupyter examples, perhaps even using mybinder.

Update for python 3.7 ?

Hi!
I was successfully using your in my previous research based in python 3.6.
Recently I had to update to 3.7 since the main circuit simulator required this. When I tried to install your package via pip I get the following:

ERROR: Cannot install ccd-tools==0.8.10, ccd-tools==0.8.11, ccd-tools==0.8.12, ccd-tools==0.8.14, ccd-tools==0.8.15, ccd-tools==0.8.16, ccd-tools==0.8.17, ccd-tools==0.8.4, ccd-tools==0.8.5, ccd-tools==0.8.6, ccd-tools==0.8.7, ccd-tools==0.8.8 and ccd-tools==0.8.9 because these package versions have conflicting dependencies.

The conflict is caused by:
ccd-tools 0.8.17 depends on sip-models
ccd-tools 0.8.16 depends on sip-models
ccd-tools 0.8.15 depends on sip_models
ccd-tools 0.8.14 depends on sip_models
ccd-tools 0.8.12 depends on sip_models
ccd-tools 0.8.11 depends on sip_models
ccd-tools 0.8.10 depends on sip_models
ccd-tools 0.8.9 depends on sip_models
ccd-tools 0.8.8 depends on sip_models
ccd-tools 0.8.7 depends on sip_models
ccd-tools 0.8.6 depends on sip_models
ccd-tools 0.8.5 depends on sip_models
ccd-tools 0.8.4 depends on sip_models

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

Upon viewing your setup.py file I suspect that you last version works in 3.6 and not in 3.7.
Any chance of an update?

Cheers!

homepage: add examples

We need a few detailed examples on the homepage.

  • dual Cole-Cole response
  • time-regularization
  • perhaps an application: imaging of crop roots

Incompatibility with Numpy 18.0.

I'm using your tools in an EIS environment and your DRFT plotter is perfect. Sadly there seems to be an issue when using the latest version of Numpy (18.0) and Python 3.6.

Error:

File "C:\Anaconda3\envs\py36\lib\site-packages\numpy\core\function_base.py", line 117, in linspace
num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Cloud\PyCode\EIS_2\run.py", line 153, in
ccd_obj.fit_data()
File "C:\Anaconda3\envs\py36\lib\site-packages\lib_dd\decomposition\ccd_single.py", line 42, in fit_data
results = list(map(decomp_single_sl.fit_one_spectrum, fit_datas))
File "C:\Anaconda3\envs\py36\lib\site-packages\lib_dd\decomposition\ccd_single_stateless.py", line 159, in fit_one_spectrum
ND = _prepare_ND_object(fit_data)
File "C:\Anaconda3\envs\py36\lib\site-packages\lib_dd\decomposition\ccd_single_stateless.py", line 96, in _prepare_ND_object
model = ccd_res.decomposition_resistivity(fit_data['inv_opts'])
File "C:\Anaconda3\envs\py36\lib\site-packages\lib_dd\models\ccd_res.py", line 31, in init
self.set_settings(settings)
File "C:\Anaconda3\envs\py36\lib\site-packages\lib_dd\models\ccd_res.py", line 50, in set_settings
settings
File "C:\Anaconda3\envs\py36\lib\site-packages\lib_dd\base_class.py", line 79, in determine_tau_range
factor_right=factor_right)
File "C:\Anaconda3\envs\py36\lib\site-packages\lib_dd\base_class.py", line 121, in get_tau_values_for_data
g_tau = np.logspace(np.log10(g_tau_fmin), np.log10(g_tau_fmax), N)
File "<array_function internals>", line 6, in logspace
File "C:\Anaconda3\envs\py36\lib\site-packages\numpy\core\function_base.py", line 272, in logspace
y = linspace(start, stop, num=num, endpoint=endpoint, axis=axis)
File "<array_function internals>", line 6, in linspace
File "C:\Anaconda3\envs\py36\lib\site-packages\numpy\core\function_base.py", line 121, in linspace
.format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.

For replication:
data
Out[2]:
array([111.5240459 , 111.27922201, 110.89255334, 110.28070184,
109.31029894, 107.76799022, 105.31651814, 101.44401546,
95.45213796, 86.61517417, 74.69325881, 60.64844596,
46.6560329 , 34.85849103, 26.157732 , 20.27772108,
16.48595453, 14.0900904 , 12.58484767, 11.63704805,
11.03784258, 10.65836886, -0.56018419, -0.87687646,
-1.36883975, -2.12754477, -3.28406441, -5.01405951,
-7.52322821, -10.9805576 , -15.34865668, -20.09620679,
-23.99015799, -25.48622686, -23.86026477, -19.89417354,
-15.13940556, -10.80141968, -7.38468767, -4.91328416,
-3.21486398, -2.08293414, -1.34115994, -0.85980969])

frequencies
Out[3]:
array([1.00000000e-02, 2.15443469e-02, 4.64158883e-02, 1.00000000e-01,
2.15443469e-01, 4.64158883e-01, 1.00000000e+00, 2.15443469e+00,
4.64158883e+00, 1.00000000e+01, 2.15443469e+01, 4.64158883e+01,
1.00000000e+02, 2.15443469e+02, 4.64158883e+02, 1.00000000e+03,
2.15443469e+03, 4.64158883e+03, 1.00000000e+04, 2.15443469e+04,
4.64158883e+04, 1.00000000e+05])

data = np.array(tmp)
frequencies = algi.bData['f_real']

set options using this dict-like object

config = cfg_single.cfg_single()
config['frequency_file'] = frequencies
config['data_file'] = data
config['fixed_lambda'] = 10
config['data_format'] = "rre_rim"

generate a ccd object

ccd_obj = ccd_single.ccd_single(config)

commence with the actual fitting

ccd_obj.fit_data()

extract the last iteration

last_it = ccd_obj.results[0].iterations[-1]

print(dir(last_it))
print('fit parameters', last_it.m)
print('stat_pars', last_it.stat_pars)
last_it.plot()

plt.figure()
ts = last_it.Data.obj.tau
dft = last_it.stat_pars['m_i'][0]
plt.plot(ts,dft)


Reverting to Numpy 1.17.4 solves the problems but this is probably not a good long term solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.