Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow sorting and printing of MesaData objects #11

Merged
merged 2 commits into from
May 27, 2020
Merged

Conversation

zingale
Copy link
Contributor

@zingale zingale commented Oct 25, 2018

These changes allow one to print and sort (by age) MESA profiles. E.g.,

profiles = glob.glob("profile*0.data")
models = []
for p in profiles:
    models.append(mr.MesaData(p)

for m in sorted(models):
    print(m)

produces

MESA model #    450, t =          158677.1499 yr
MESA model #    900, t =          9371689.143 yr
MESA model #   1350, t =          934449849.7 yr
MESA model #   1850, t =          994276962.1 yr
MESA model #   2350, t =           1011636738 yr
MESA model #   2850, t =           1021325384 yr
MESA model #   3350, t =           1027557774 yr
MESA model #   3850, t =           1031542396 yr
MESA model #   4350, t =           1034313116 yr
MESA model #   4850, t =           1036342629 yr
MESA model #   5350, t =           1037887011 yr
MESA model #   5850, t =           1039104992 yr
MESA model #   6350, t =           1040087688 yr
MESA model #   6850, t =           1040898244 yr
MESA model #   7350, t =           1041578008 yr
MESA model #   7850, t =           1042156309 yr
MESA model #   8350, t =           1042653626 yr
MESA model #   8850, t =           1043085731 yr
MESA model #   9350, t =           1043465657 yr
MESA model #   9850, t =           1043801929 yr

@wmwolf
Copy link
Owner

wmwolf commented May 27, 2020

Well this somehow went a year and a half without my remembering, but it seems like a welcome addition. Thanks, Mike!

@wmwolf wmwolf merged commit 1c778be into wmwolf:master May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants