[yt-svn] commit/yt: 5 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Apr 28 11:41:42 PDT 2014
5 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/ae8c869f28fd/
Changeset: ae8c869f28fd
Branch: yt-3.0
User: hegan
Date: 2014-04-21 17:52:59
Summary: exiting gracefully when no halos are found
Affected #: 2 files
diff -r 71196d4289bf76aa13209127a8c1f36cb6dc5c49 -r ae8c869f28fd3f9a8ca7e783f32735213d48494b yt/analysis_modules/halo_analysis/halo_catalog.py
--- a/yt/analysis_modules/halo_analysis/halo_catalog.py
+++ b/yt/analysis_modules/halo_analysis/halo_catalog.py
@@ -33,6 +33,8 @@
finding_method_registry, \
quantity_registry
+from yt.utilities.logger import ytLogger as mylog
+
class HaloCatalog(ParallelAnalysisInterface):
r"""Create a HaloCatalog: an object that allows for the creation and association
of data with a set of halo objects.
@@ -351,6 +353,10 @@
if self.halos_pf is None:
# Find the halos and make a dataset of them
self.halos_pf = self.finder_method(self.data_pf)
+ if self.halos_pf is None:
+ mylog.warning('No halos were found for {0}'.format(\
+ self.data_pf.basename))
+ return
# Assign pf and data sources appropriately
self.data_source = self.halos_pf.all_data()
diff -r 71196d4289bf76aa13209127a8c1f36cb6dc5c49 -r ae8c869f28fd3f9a8ca7e783f32735213d48494b yt/analysis_modules/halo_analysis/halo_finding_methods.py
--- a/yt/analysis_modules/halo_analysis/halo_finding_methods.py
+++ b/yt/analysis_modules/halo_analysis/halo_finding_methods.py
@@ -25,6 +25,7 @@
from .operator_registry import \
finding_method_registry
+
def add_finding_method(name, function):
finding_method_registry[name] = HaloFindingMethod(function)
@@ -75,8 +76,14 @@
rh = RockstarHaloFinder(pf)
rh.run()
+
+
halos_pf = RockstarDataset("rockstar_halos/halos_0.0.bin")
- halos_pf.create_field_info()
+ try:
+ halos_pf.create_field_info()
+ except:
+ return None
+
return halos_pf
add_finding_method("rockstar", _rockstar_method)
@@ -87,6 +94,8 @@
num_halos = len(halo_list)
+ if num_halos == 0: return None
+
# Set up fields that we want to pull from identified halos and their units
new_fields = ['particle_identifier', 'particle_mass', 'particle_position_x',
'particle_position_y','particle_position_z',
https://bitbucket.org/yt_analysis/yt/commits/29edfed096b6/
Changeset: 29edfed096b6
Branch: yt-3.0
User: hegan
Date: 2014-04-21 19:00:38
Summary: changed bare except to except ValueError
Affected #: 1 file
diff -r ae8c869f28fd3f9a8ca7e783f32735213d48494b -r 29edfed096b622ea1e88d950f07594525e6b5d7b yt/analysis_modules/halo_analysis/halo_finding_methods.py
--- a/yt/analysis_modules/halo_analysis/halo_finding_methods.py
+++ b/yt/analysis_modules/halo_analysis/halo_finding_methods.py
@@ -81,7 +81,7 @@
halos_pf = RockstarDataset("rockstar_halos/halos_0.0.bin")
try:
halos_pf.create_field_info()
- except:
+ except ValueError:
return None
return halos_pf
https://bitbucket.org/yt_analysis/yt/commits/5b84563afe14/
Changeset: 5b84563afe14
Branch: yt-3.0
User: hegan
Date: 2014-04-23 20:41:01
Summary: writes out blank catalog
Affected #: 1 file
diff -r 29edfed096b622ea1e88d950f07594525e6b5d7b -r 5b84563afe149ba5834f93ce1a858507e6ae4319 yt/analysis_modules/halo_analysis/halo_catalog.py
--- a/yt/analysis_modules/halo_analysis/halo_catalog.py
+++ b/yt/analysis_modules/halo_analysis/halo_catalog.py
@@ -356,6 +356,10 @@
if self.halos_pf is None:
mylog.warning('No halos were found for {0}'.format(\
self.data_pf.basename))
+ if save_catalog:
+ self.halos_pf = self.data_pf
+ self.save_catalog()
+ self.halos_pf = None
return
# Assign pf and data sources appropriately
https://bitbucket.org/yt_analysis/yt/commits/93afd98894d3/
Changeset: 93afd98894d3
Branch: yt-3.0
User: hegan
Date: 2014-04-28 20:28:52
Summary: Don't double import myLog
Affected #: 1 file
diff -r 5b84563afe149ba5834f93ce1a858507e6ae4319 -r 93afd98894d3d8ffc7534072e371c40ecf3d2bf0 yt/analysis_modules/halo_analysis/halo_catalog.py
--- a/yt/analysis_modules/halo_analysis/halo_catalog.py
+++ b/yt/analysis_modules/halo_analysis/halo_catalog.py
@@ -33,8 +33,6 @@
finding_method_registry, \
quantity_registry
-from yt.utilities.logger import ytLogger as mylog
-
class HaloCatalog(ParallelAnalysisInterface):
r"""Create a HaloCatalog: an object that allows for the creation and association
of data with a set of halo objects.
https://bitbucket.org/yt_analysis/yt/commits/5affa74d80f3/
Changeset: 5affa74d80f3
Branch: yt-3.0
User: brittonsmith
Date: 2014-04-28 20:41:29
Summary: Merged in hegan/yt/yt-3.0 (pull request #845)
exiting gracefully when no halos are found
Affected #: 2 files
diff -r 3cb702b86a173b0c5165ee771e674bde9e850a82 -r 5affa74d80f34e32c9137bd4ed03821b7ac17570 yt/analysis_modules/halo_analysis/halo_catalog.py
--- a/yt/analysis_modules/halo_analysis/halo_catalog.py
+++ b/yt/analysis_modules/halo_analysis/halo_catalog.py
@@ -351,6 +351,14 @@
if self.halos_pf is None:
# Find the halos and make a dataset of them
self.halos_pf = self.finder_method(self.data_pf)
+ if self.halos_pf is None:
+ mylog.warning('No halos were found for {0}'.format(\
+ self.data_pf.basename))
+ if save_catalog:
+ self.halos_pf = self.data_pf
+ self.save_catalog()
+ self.halos_pf = None
+ return
# Assign pf and data sources appropriately
self.data_source = self.halos_pf.all_data()
diff -r 3cb702b86a173b0c5165ee771e674bde9e850a82 -r 5affa74d80f34e32c9137bd4ed03821b7ac17570 yt/analysis_modules/halo_analysis/halo_finding_methods.py
--- a/yt/analysis_modules/halo_analysis/halo_finding_methods.py
+++ b/yt/analysis_modules/halo_analysis/halo_finding_methods.py
@@ -25,6 +25,7 @@
from .operator_registry import \
finding_method_registry
+
def add_finding_method(name, function):
finding_method_registry[name] = HaloFindingMethod(function)
@@ -75,8 +76,14 @@
rh = RockstarHaloFinder(pf)
rh.run()
+
+
halos_pf = RockstarDataset("rockstar_halos/halos_0.0.bin")
- halos_pf.create_field_info()
+ try:
+ halos_pf.create_field_info()
+ except ValueError:
+ return None
+
return halos_pf
add_finding_method("rockstar", _rockstar_method)
@@ -87,6 +94,8 @@
num_halos = len(halo_list)
+ if num_halos == 0: return None
+
# Set up fields that we want to pull from identified halos and their units
new_fields = ['particle_identifier', 'particle_mass', 'particle_position_x',
'particle_position_y','particle_position_z',
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list