Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lscsoft
bilby
Commits
d1c7d12c
Commit
d1c7d12c
authored
6 years ago
by
Moritz
Browse files
Options
Downloads
Patches
Plain Diff
Added basic custom exception classes.
parent
5ebe14d6
No related branches found
No related tags found
1 merge request
!230
Resolve "PEP8 Imports"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bilby/core/sampler/base_sampler.py
+15
-3
15 additions, 3 deletions
bilby/core/sampler/base_sampler.py
with
15 additions
and
3 deletions
bilby/core/sampler/base_sampler.py
+
15
−
3
View file @
d1c7d12c
...
...
@@ -145,9 +145,9 @@ class Sampler(object):
external_sampler_name
=
self
.
__class__
.
__name__
.
lower
()
try
:
self
.
external_sampler
=
__import__
(
external_sampler_name
)
except
(
ImportError
,
SystemExit
):
raise
Import
Error
(
"
Sampler {} not installed on this system
"
.
format
(
external_sampler_name
))
except
(
ImportError
,
SystemExit
,
ModuleNotFoundError
):
raise
SamplerNotInstalled
Error
(
"
Sampler {}
is
not installed on this system
"
.
format
(
external_sampler_name
))
def
_verify_kwargs_against_default_kwargs
(
self
):
"""
...
...
@@ -475,3 +475,15 @@ class MCMCSampler(Sampler):
except
emcee
.
autocorr
.
AutocorrError
as
e
:
self
.
result
.
max_autocorrelation_time
=
None
logger
.
info
(
"
Unable to calculate autocorr time: {}
"
.
format
(
e
))
class
Error
(
Exception
):
"""
Base class for all exceptions raised by this module
"""
class
SamplerError
(
Error
):
"""
Base class for Error related to samplers in this module
"""
class
SamplerNotInstalledError
(
SamplerError
):
"""
Base class for Error raised by not installed samplers
"""
This diff is collapsed.
Click to expand it.
Gregory Ashton
@gregory.ashton
mentioned in issue
#263 (closed)
·
6 years ago
mentioned in issue
#263 (closed)
mentioned in issue #263
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment