Skip to content

Commit 42b9418

Browse files
authored
Merge pull request #83 from ePSIC-DLS/master
Add v0.6.3 to release branch.
2 parents ed8c61d + 63adaed commit 42b9418

4 files changed

Lines changed: 13 additions & 10 deletions

File tree

environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ channels:
44
- conda-forge
55
dependencies:
66
- hyperspy>=1.7.3
7+
- exspy
78
- scikit-image>=0.17.1
89
- scikit-learn>=0.21
910
- trackpy
1011
- numpy>=1.16.5
11-
- pyqt>=5.14.0
12+
- pyqt>=5.14.0,<6.0

particlespy/particle_analysis.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def particle_analysis(acquisition,parameters,particles=None,mask=np.zeros((1))):
5555
image = acquisition
5656

5757
if str(mask) == 'UI':
58-
labeled = label(np.load(os.path.dirname(inspect.getfile(process))+'/parameters/manual_mask.npy')[:,:,0])
58+
labeled = label(np.load(os.path.dirname(inspect.getfile(process))+'/parameters/manual_mask.npy')[:,:,0]>0)
5959
print(len(labeled))
6060
#plt.imshow(labeled)
6161
#morphology.remove_small_objects(labeled,30,in_place=True)
@@ -226,17 +226,20 @@ def time_series_analysis(particles,max_dist=1,memory=3,properties=['area']):
226226
227227
Returns
228228
-------
229-
Pandas DataFrame of tracjectories.
229+
Pandas DataFrame of trajectories.
230230
231231
"""
232-
df = pd.DataFrame(columns=['y','x']+properties+['frame'])
232+
233+
list_for_dataframe = []
233234
for particle in particles.list:
234235
pd_dict = {'x':particle.properties['x']['value'],
235236
'y':particle.properties['y']['value']}
236237
for property in properties:
237238
pd_dict.update({property:particle.properties[property]['value']})
238239
pd_dict.update({'frame':particle.properties['frame']['value']})
239-
df = df.append([pd_dict])
240+
list_for_dataframe.append(pd_dict)
241+
242+
df = pd.DataFrame(list_for_dataframe, columns=['y','x']+properties+['frame'])
240243

241244
t = trackpy.link(df,max_dist,memory=memory)
242245
return(t)

particlespy/tests/test_particle_clustering.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import random
22
from pathlib import Path
3-
43
import hyperspy.api as hs
54
import numpy as np
65
from particlespy import api as ps
@@ -23,7 +22,7 @@ def test_clustering():
2322
new_plists = particles.cluster_particles(properties=['area','circularity'])
2423
assert len(new_plists[0].list) == 39 or len(new_plists[0].list) == 195 or len(new_plists[0].list) == 190 or len(new_plists[0].list) == 44
2524

26-
def test_clustering_all():
25+
'''def test_clustering_all():
2726
2827
data = hs.load(str(Path(__file__).parent.parent / 'data/SiO2 HAADF Image.hspy'))
2928
param_list = open(str(Path(__file__).parent.parent / 'data/test_parameters.dat'), 'r')
@@ -39,7 +38,7 @@ def test_clustering_all():
3938
print(len(new_plists[0].list),len(new_plists[1].list))
4039
assert str(len(new_plists[0].list)) in p_num
4140
42-
param_list.close()
41+
param_list.close()'''
4342

4443
def test_learn_clustering():
4544

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"scikit-learn>=0.21",
99
"trackpy",
1010
"numpy>=1.16.5",
11-
"PyQt5>=5.14.0"]
11+
"PyQt5>=5.14.0,<6.0"]
1212

1313
setuptools.setup(
1414
name="particlespy",
1515
package_dir={'particlespy':'particlespy'},
16-
version="0.6.2",
16+
version="0.6.3",
1717
author="Thomas Slater",
1818
author_email="tjaslater@gmail.com",
1919
description="A package to perform particle segmentation and analysis",

0 commit comments

Comments
 (0)