Skip to content

Commit 1546a7d

Browse files
author
Randall C. O'Reilly
committed
change import paths to go-python and remove the attempt to type-qualify enum constants -- didn't work.
1 parent e13808e commit 1546a7d

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"go/ast"
1616
"go/token"
1717

18-
"github.com/goki/gotopy/pyprint"
18+
"github.com/go-python/gotopy/pyprint"
1919
)
2020

2121
// format formats the given package file originally obtained from src

gotopy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import (
2626
"runtime/pprof"
2727
"strings"
2828

29-
"github.com/goki/gotopy/diff"
30-
"github.com/goki/gotopy/pyprint"
29+
"github.com/go-python/gotopy/diff"
30+
"github.com/go-python/gotopy/pyprint"
3131
)
3232

3333
var (

pyedits.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"bytes"
99
"strings"
1010

11-
"github.com/goki/gotopy/pyprint"
11+
"github.com/go-python/gotopy/pyprint"
1212
)
1313

1414
// moveLines moves the st,ed region to 'to' line

pyprint/nodes.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,13 @@ func isBinary(expr ast.Expr) bool {
793793
}
794794

795795
func (p *printer) ident(id *ast.Ident) {
796-
// if id.Name == "AlphaCycle" {
797-
// fmt.Printf("%+V\n", id)
796+
// todo: this was an attempt to deal with "enums" by printing type then
797+
// name -- didn't work -- could return to this but not high priority
798+
// if id.Obj != nil && id.Obj.Kind == ast.Con && id.Name != id.Obj.Name {
799+
// // constants are assumed to be Enums -- use type scoping for python
800+
// // fmt.Printf("id: %+v\n", id)
801+
// p.print(id.Obj.Name, token.PERIOD)
798802
// }
799-
// todo: seems like Obj is typically nil.. not sure how to fix this..
800-
if id.Obj != nil && id.Obj.Kind == ast.Con { // constants are assumed to be Enums -- use type scoping for python
801-
p.print(id.Obj.Name, token.PERIOD)
802-
}
803803
p.print(id.Pos(), id)
804804
}
805805

testdata/ra25.golden

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def guirun():
5555
win.StartEventLoop()
5656

5757
# LogPrec is precision for saving float values in logs
58-
LogPrec.LogPrec = 4
58+
LogPrec = 4
5959

6060
# ParamSets is the default set of parameters -- Base is always applied, and others can be optionally
6161
# selected to apply on top of that
@@ -849,7 +849,7 @@ class Sim(pygiv.ClassViewObj):
849849
dt.SetMetaData("name", "TrnEpcLog")
850850
dt.SetMetaData("desc", "Record of performance over epochs of training")
851851
dt.SetMetaData("read-only", "true")
852-
dt.SetMetaData("precision", str(LogPrec.LogPrec))
852+
dt.SetMetaData("precision", str(LogPrec))
853853

854854
sch = etable.Schema(
855855
("Run", etensor.INT64, go.nil, go.nil),
@@ -928,7 +928,7 @@ class Sim(pygiv.ClassViewObj):
928928
dt.SetMetaData("name", "TstTrlLog")
929929
dt.SetMetaData("desc", "Record of testing per input pattern")
930930
dt.SetMetaData("read-only", "true")
931-
dt.SetMetaData("precision", str(LogPrec.LogPrec))
931+
dt.SetMetaData("precision", str(LogPrec))
932932

933933
nt = ss.TestEnv.Table.Len() # number in view
934934
sch = etable.Schema(
@@ -1012,7 +1012,7 @@ class Sim(pygiv.ClassViewObj):
10121012
dt.SetMetaData("name", "TstEpcLog")
10131013
dt.SetMetaData("desc", "Summary stats for testing trials")
10141014
dt.SetMetaData("read-only", "true")
1015-
dt.SetMetaData("precision", str(LogPrec.LogPrec))
1015+
dt.SetMetaData("precision", str(LogPrec))
10161016

10171017
dt.SetFromSchema(etable.Schema(
10181018
("Run", etensor.INT64, go.nil, go.nil),
@@ -1060,7 +1060,7 @@ class Sim(pygiv.ClassViewObj):
10601060
dt.SetMetaData("name", "TstCycLog")
10611061
dt.SetMetaData("desc", "Record of activity etc over one trial by cycle")
10621062
dt.SetMetaData("read-only", "true")
1063-
dt.SetMetaData("precision", str(LogPrec.LogPrec))
1063+
dt.SetMetaData("precision", str(LogPrec))
10641064

10651065
np = 100 # max cycles
10661066
sch = etable.Schema(
@@ -1127,7 +1127,7 @@ class Sim(pygiv.ClassViewObj):
11271127
dt.SetMetaData("name", "RunLog")
11281128
dt.SetMetaData("desc", "Record of performance at end of training")
11291129
dt.SetMetaData("read-only", "true")
1130-
dt.SetMetaData("precision", str(LogPrec.LogPrec))
1130+
dt.SetMetaData("precision", str(LogPrec))
11311131

11321132
dt.SetFromSchema(etable.Schema(
11331133
("Run", etensor.INT64, go.nil, go.nil),

0 commit comments

Comments
 (0)