marrink-lab / polyply_1.0

Generate input parameters and coordinates for atomistic and coarse-grained simulations of polymers, ssDNA, and carbohydrates
Apache License 2.0
122 stars 21 forks source link

Log entries #292

Closed fgrunewald closed 1 year ago

fgrunewald commented 1 year ago

With vermouth v0.9.0 we can now have log-entries in ff-files. This implements such entries to polyply gen_params. One nice thing to use these for is to raise a warning whenever people are not applying termini to polymers or to print ff parameters in case they are not part of the default force-field.

@pckroon do you have any idea why in the current setup info messages wouldn't be printed? Warnings and Errors are info.

pckroon commented 1 year ago

@pckroon do you have any idea why in the current setup info messages wouldn't be printed? Warnings and Errors are info.

What do you mean by this? Do Warnings and Errors get logged as Info? Do Info entries not show up at all?

fgrunewald commented 1 year ago

@pckroon do you have any idea why in the current setup info messages wouldn't be printed? Warnings and Errors are info.

What do you mean by this? Do Warnings and Errors get logged as Info? Do Info entries not show up at all?

the info doesn't show up at all

pckroon commented 1 year ago

What's your loglevel and do you set that before parsing the ff files?

fgrunewald commented 1 year ago

the default logleve is zero, which translates to logging.INFO. I thought that would be enough

pckroon commented 1 year ago

Have you tried printing the molecule.logentries before trying to log them?

fgrunewald commented 1 year ago

@pckroon so it seems that the info lines are not parsed because the log level evaluation does not evaluate to True. But I don't really understand why, since it also don't respond to adjustment of the Loglevel. Could it be that it imports the wrong Logger from vermouth and not polyply?

fgrunewald commented 1 year ago

@pckroon regarding adding those tests for vermouth: the only problem is that in this case I can call the itp workflow from the library since it is a function. But for the vermouth tests we mostly run integration tests, for which the context capturing of the logs doesn't work.

pckroon commented 1 year ago

I'm reasonably sure we have selective tests for ffinput.py in vermouth, but meh. Maybe later. Good intro project for new people that want to get involved maybe.

fgrunewald commented 1 year ago

@pckroon sure for ffinput but this test here also checks that the whole thing propagates through he program and gets actually printed. The ffinput tests I can add no problem. But also good to get started indeed.