Skip to content

print model should mention name of source #82

Closed
@rbiswas4

Description

@rbiswas4

print model is supposed to return a summary of the SN model at any point. At present, if a Model is instantiated by

model = sncosmo.Model(source='salt2')
p = {'z':0.5, 'c': 0.1, 'x0': 4.6e-7., 'x1': 1.2}
model.set(**p)
print model

print model
<Model at 0x103888750>
source:
  class      : SALT2Source
  name       : None
  version    : None
  phases     : [-20, .., 50] days
  wavelengths: [2000, .., 9200] Angstroms
parameters:
  z  = 0.5
  t0 = 0.0
  x0 = 4.5999999999999999e-07
  x1 = 1.2
  c  = 0.10000000000000001

So, this is printing out the fact that it is a SALT2SOURCE, but does not mention the actual model. This is probably because this does not assign a name to the source.

print model.source.name
None

Does it make sense to try to make the filename a source name by default (unless the user chooses to specify something else), so that one can see how they started the model?

Activity

kbarbary

kbarbary commented on Mar 31, 2015

@kbarbary
Member

Looks like the name and version keyword arguments are not being passed
correctly for the built in models.
On Mar 31, 2015 11:09 AM, "rbiswas4" notifications@github.com wrote:

print model is supposed to return a summary of the SN model at any point.
At present, if a Model is instantiated by

model = sncosmo.Model(source='salt2')
p = {'z':0.5, 'c': 0.1, 'x0': 4.6e-7., 'x1': 1.2}
model.set(**p)
print model

rint model
<Model at 0x103888750>
source:
class : SALT2Source
name : None
version : None
phases : [-20, .., 50] days
wavelengths: [2000, .., 9200] Angstroms
parameters:
z = 0.5
t0 = 0.0
x0 = 4.5999999999999999e-07
x1 = 1.2
c = 0.10000000000000001```


Reply to this email directly or view it on GitHub
#82.

rbiswas4

rbiswas4 commented on Mar 31, 2015

@rbiswas4
MemberAuthor

Yes, I think there was an intent at some point that users should be able to assign a name of their choice to a source when creating a SALT2Source. But when using a built-in, this should not be None.

kbarbary

kbarbary commented on Mar 31, 2015

@kbarbary
Member

It used to be 'salt2' but looks like something changed in the process of
refactoring the built in data.
On Mar 31, 2015 11:33 AM, "rbiswas4" notifications@github.com wrote:

Yes, I think there was an intent at some point that users should be able
to assign a name of their choice to a source when creating a SALT2Source.
But when using a built-in, this should not be None.


Reply to this email directly or view it on GitHub
#82 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      `print model` should mention name of source · Issue #82 · sncosmo/sncosmo