Skip to content

Commit

Permalink
Merge pull request #10422 from gem/info_sources
Browse files Browse the repository at this point in the history
Improved `oq info sources`
  • Loading branch information
micheles authored Mar 7, 2025
2 parents 517c734 + 7e2169f commit 021be14
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openquake/commands/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,11 @@ def main(what, report=False):
col.append(' ' * maxlen)
print(''.join(col))
elif what == 'sources':
for cls in gen_subclasses(BaseSeismicSource):
print(cls.__name__)
pairs = sorted((cls.__name__, cls.code)
for cls in gen_subclasses(BaseSeismicSource)
if hasattr(cls, 'code'))
for i, (name, code) in enumerate(pairs, 1):
print('%02d' % i, code.decode('ascii'), name)
elif what == 'disagg':
for out in pmf_map:
print(out)
Expand Down

0 comments on commit 021be14

Please sign in to comment.