naojsoft / qplan

Other
2 stars 4 forks source link

add Grade to the report #11

Closed monodera closed 5 years ago

monodera commented 5 years ago

I tried to make a pull request, but denied as I don't have a permission to commit (perhaps).

I (and other SAs such as Terai-san) thought that it would be a good idea to add a column of Grade to the Report after scheduling. I made a local change as follows. Could you please review and make a modification if it looks okay?

diff --git a/qplan/plugins/Report.py b/qplan/plugins/Report.py
index b43a224..fb74d3c 100644
--- a/qplan/plugins/Report.py
+++ b/qplan/plugins/Report.py
@@ -196,8 +196,8 @@ class Report(PlBase.Plugin):
             ndate, filters))
         out_f.write("Queue prepared at: %s\n" % (
             time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())))
-        out_f.write("%-16.16s  %-8.8s  %-10.10s %12.12s  %5.5s %7.7s %-10.10s %-6.6s  %3.3s  %s\n" % (
-            'Date', 'ObsBlk', 'Code', 'Program', 'Rank', 'Time',
+        out_f.write("%-16.16s  %-8.8s  %-10.10s %12.12s  %5.5s  %5.5s %7.7s %-10.10s %-6.6s  %3.3s  %s\n" % (
+            'Date', 'ObsBlk', 'Code', 'Program', 'Grade', 'Rank', 'Time',
             'Target', 'Filter', 'AM', 'Comment'))

         targets = {}
@@ -214,8 +214,8 @@ class Report(PlBase.Plugin):
                     key = (ob.target.ra, ob.target.dec)
                     targets[key] = ob.target

-                out_f.write("%-16.16s  %-8.8s  %-10.10s %12.12s  %5.2f %7.2f %-10.10s %-6.6s  %3.1f  %s\n" % (
-                    date, str(ob), ob.name, ob.program, ob.program.rank,
+                out_f.write("%-16.16s  %-8.8s  %-10.10s %12.12s  %5.5s  %5.2f %7.2f %-10.10s %-6.6s  %3.1f  %s\n" % (
+                    date, str(ob), ob.name, ob.program, ob.program.grade, ob.program.rank,
                     ob.total_time / 60, ob.target.name,
                     ob.inscfg.filter, ob.envcfg.airmass,
                     comment))
ejeschke commented 5 years ago

@monodera, you should be able to make a PR. Did you fork qplan to your own github account? Then clone your repo from that fork. In your cloned repo, make a branch and do your edit in the branch. Then push your branch back up to your repo on github (always best to keep master aligned with the upstream repo). When you visit your repo on github you will see the option to make a PR.

Most likely your clone is from the naojsoft repo, not your fork. Then you wouldn't have permission to push.

ejeschke commented 5 years ago

But in any case we can expedite this for you, if you don't want to go to the trouble.

monodera commented 5 years ago

Yes, my repository is cloned from naojsoft, not forked to my account. Ok, probably it's a good opportunity for me to practice to make a pull request etc. Please let me try.

ejeschke commented 5 years ago

So, can we close this, since #12 is merged?

monodera commented 5 years ago

Yes, I think so. (I already deleted the branch).