Skip to content
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

Rename public exports to exclude HDF5 prefix #690

Merged
merged 6 commits into from
Oct 7, 2020
Merged

Rename public exports to exclude HDF5 prefix #690

merged 6 commits into from
Oct 7, 2020

Conversation

musm
Copy link
Member

@musm musm commented Oct 6, 2020

No description provided.

@musm musm requested review from jmert and kleinhenz October 6, 2020 06:05
src/deprecated.jl Show resolved Hide resolved
src/HDF5.jl Outdated Show resolved Hide resolved
src/HDF5.jl Outdated Show resolved Hide resolved
@musm
Copy link
Member Author

musm commented Oct 6, 2020

Review comments addressed.

@musm
Copy link
Member Author

musm commented Oct 6, 2020

What is the point of the has function that is exported...

@jmert
Copy link
Contributor

jmert commented Oct 6, 2020

What is the point of the has function that is exported...

It looks like really old legacy naming from very early Julia ?? — JuliaLang/julia@3ca22bd

@musm
Copy link
Member Author

musm commented Oct 6, 2020

It looks like really old legacy naming from very early Julia ?? — JuliaLang/julia@3ca22bd

Good digging, probably that explains this 😄

@musm
Copy link
Member Author

musm commented Oct 6, 2020

I don't think this PR is controversial. Looking at the update, the code is so much cleaner and better IMO.

@musm
Copy link
Member Author

musm commented Oct 6, 2020

I'll merge sans objections?

@@ -1381,8 +1380,8 @@ end
# Create datasets and attributes with "native" types, but don't write the data.
# The return syntax is: dset, dtype = d_create(parent, name, data; properties...)
for (privatesym, fsym, ptype) in
((:_d_create, :d_create, Union{HDF5File, HDF5Group}),
(:_a_create, :a_create, Union{HDF5File, HDF5Group, HDF5Dataset, HDF5Datatype}))
((:_d_create, :d_create, Union{File,Group}),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to unroll these to improve precompile speeds?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I think it'd be OK to wait on for another PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely new PR but thought I'd mention it.

@@ -85,13 +84,13 @@ hdf5_type_id(::Type{Int64}) = H5T_NATIVE_INT64
hdf5_type_id(::Type{UInt64}) = H5T_NATIVE_UINT64
hdf5_type_id(::Type{Float32}) = H5T_NATIVE_FLOAT
hdf5_type_id(::Type{Float64}) = H5T_NATIVE_DOUBLE
hdf5_type_id(::Type{HDF5ReferenceObj}) = H5T_STD_REF_OBJ
hdf5_type_id(::Type{Reference}) = H5T_STD_REF_OBJ

hdf5_type_id(::Type{S}) where {S<:AbstractString} = H5T_C_S1
hdf5_type_id(::Type{C}) where {C<:CharType} = H5T_C_S1

const HDF5BitsKind = Union{Bool, Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float32, Float64}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are used internally, but could also remove the HDF5 prefix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a couple of others like this including HDF5Scalar that are internally used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmert Should I save these changes in a new PR ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do them in a separate PR since they are more internal utility constants, rather than user-facing ones, so logically it would make sense to be a separate PR.

@@ -51,8 +51,8 @@ dims, max_dims = HDF5.get_dims(b)
@test dims == (UInt64(10000),)
@test max_dims == (HDF5.H5S_UNLIMITED,)
#println("b is size current $(map(int,HDF5.get_dims(b)[1])) max $(map(int,HDF5.get_dims(b)[2]))")
# b[:] = [1:10000] # gave error no method lastindex(HDF5Dataset{PlainHDF5File},),
# so I defined lastindex(dset::HDF5Dataset) = length(dset), and exported lastindex
# b[:] = [1:10000] # gave error no method lastindex(HDF5.Dataset{PlainHDF5File},),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but what's up with the type parameter here? I'm guessing just something long out of date?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, I noticed this too PlainHDF5File doesn't exist, probably old legacy code.

@@ -1381,8 +1380,8 @@ end
# Create datasets and attributes with "native" types, but don't write the data.
# The return syntax is: dset, dtype = d_create(parent, name, data; properties...)
for (privatesym, fsym, ptype) in
((:_d_create, :d_create, Union{HDF5File, HDF5Group}),
(:_a_create, :a_create, Union{HDF5File, HDF5Group, HDF5Dataset, HDF5Datatype}))
((:_d_create, :d_create, Union{File,Group}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I think it'd be OK to wait on for another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants