-
Notifications
You must be signed in to change notification settings - Fork 33
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
all: moves to camel case naming #38
base: master
Are you sure you want to change the base?
Conversation
This patch is in regard to issue #37 and features a major renaming of all affected variables.
This will answer some of your questions. Data Type is two words, so it can be made Dataspace is a single compound word, so it should remain (English is weird). ID should be For the It seems reasonable to keep the |
cmd/test-go-cpxcmpd/main.go
Outdated
@@ -67,20 +67,20 @@ func main() { | |||
panic(err) | |||
} | |||
defer f.Close() | |||
fmt.Printf(":: file [%s] created (id=%d)\n", fname, f.ID()) | |||
fmt.Printf(":: file [%s] created (id=%d)\n", fname, f.Id()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the ID changes.
cmd/test-go-cpxcmpd/main.go
Outdated
|
||
// create the memory data type | ||
dtype, err := hdf5.NewDatatypeFromValue(s1[0]) | ||
dType, err := hdf5.NewDatatypeFromValue(s1[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be really happy if these all just became typ
.
h5a_attribute.go
Outdated
defer C.free(unsafe.Pointer(c_name)) | ||
hid := C.H5Acreate2(id, c_name, dtype.id, dspace.id, acpl.id, P_DEFAULT.id) | ||
if err := checkID(hid); err != nil { | ||
func createAttribute(id C.hid_t, name string, dType *Datatype, dSpace *Dataspace, acpl *PropList) (*Attribute, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, for the Dataspace
labels, just spc
.
h5d_dataset.go
Outdated
var filespace_id, memspace_id C.hid_t = 0, 0 | ||
if memspace != nil { | ||
memspace_id = memspace.id | ||
var fileSpaceId, memSpaceId C.hid_t = 0, 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the redundant assignment and change to fileSpaceID, memSpaceID
.
func (s *Dataset) ReadSubset(data interface{}, memspace, filespace *Dataspace) error { | ||
dtype, err := s.Datatype() | ||
defer dtype.Close() | ||
func (s *Dataset) ReadSubset(data interface{}, memSpace, fileSpace *Dataspace) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are good though.
h5t_types.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
var ptrPathLen int | ||
n := t.NumField() | ||
for i := 0; i < n; i++ { | ||
f := t.Field(i) | ||
var field_dt *Datatype | ||
field_dt, err = NewDataTypeFromType(f.Type) | ||
var fieldDT *Datatype |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ft
h5t_types.go
Outdated
@@ -440,36 +440,36 @@ func NewDataTypeFromType(t reflect.Type) (*Datatype, error) { | |||
|
|||
case reflect.Struct: | |||
sz := int(t.Size()) | |||
cdt, err := NewCompoundType(sz) | |||
cDT, err := NewCompoundType(sz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave this one.
h5t_types_test.go
Outdated
@@ -110,30 +110,30 @@ func TestStructDatatype(t *testing.T) { | |||
|
|||
// Test that the type can be constructed and that the number of | |||
// members is as expected. | |||
var dtypes []*Datatype | |||
var dTypes []*Datatype |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
types
h5t_types_test.go
Outdated
|
||
// "Regular" value | ||
dtype, err := NewDatatypeFromValue(test) | ||
dType, err := NewDatatypeFromValue(test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typ
hdf5.go
Outdated
@@ -16,8 +16,8 @@ import ( | |||
func init() { | |||
err := h5err(C.H5open()) | |||
if err != nil { | |||
err_str := fmt.Sprintf("pb calling H5open(): %s", err) | |||
panic(err_str) | |||
errStr := fmt.Sprintf("pb calling H5open(): %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge these lines and save the transient label.
Good comments, @kortschak! Thx! I found one more thing that I really dislike. We have some mix-up in the test cases when it comes to Furthermore, I suggest that we also rename |
Hi guys,
I had a stab at #37 and renamed the variables. Took me a bit longer than expected as so many variables are affected and maybe I did not even catch them all...
Nevertheless, some points are still up for discussion and I hope we can discuss them as part of this PR:
What shall we do about the Datatype vs. DataType issue? I saw that @sbinet had once a stab at this. I still suggest that we move what is called
Datatype
toDataType
as part of this PR and then rethink later if we want to move to what you said in #9, @kortschak. The same goes forDataspace
which should maybe also be calledDataSpace
?Id vs. ID. Right now I moved everything to
Id
, but I am not quite sure ifID
is the better way. The go standard lib uses the prior whilegolint
suggest the latter. Any opinion?_go_types in h5t_types.go. Should we rename e.g.
_go_int8_t
togoInt8T
?ALL_CAPS_VARS as we have them in
h5t_shim.go
should stay as they are, right?