Skip to content

Commit

Permalink
Remove Table dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiede committed Dec 17, 2024
1 parent 890262a commit bb7167c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CondaPkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ pynfft = ">1.0"
[pip.deps]
ehtim = ">=1.2.9, <2.0"
numpy = ">=1.24, <2.0"
setuptools = ""

4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name = "Pyehtim"
uuid = "3d61700d-6e5b-419a-8e22-9c066cf00468"
authors = ["Paul Tiede <[email protected]> and contributors"]
version = "0.1.3"
version = "0.2.0"

[deps]
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"

[compat]
CondaPkg = "0.2"
PythonCall = "0.9"
TypedTables = "1"
Reexport = "1"
julia = "1.7"

Expand Down
13 changes: 7 additions & 6 deletions src/Pyehtim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Pyehtim

using Reexport
@reexport using PythonCall
using TypedTables
const ehtim = PythonCall.pynew()

export ehtim,
Expand All @@ -26,7 +25,7 @@ function get_datatable(obs)
pyconvert(Vector, getindex(obsamps, i))
end

return Table(NamedTuple{nj}(Tuple(d)))
return NamedTuple{nj}(Tuple(d))
end

"""
Expand All @@ -35,7 +34,7 @@ end
Construct the array table for a given eht-imaging obsdata object.
"""
function get_arraytable(obs)
return Table(
return (
sites = pyconvert(Vector{Symbol}, obs.tarr["site"]),
X = pyconvert(Vector, obs.tarr["x"]),
Y = pyconvert(Vector, obs.tarr["y"]),
Expand All @@ -59,7 +58,7 @@ are fitting **scan averaged** data.
"""
function scan_average(obs)
obsc = obs.copy()
obsc.add_scans()
obsc.add_scans() # Add the scans before averaging otherwise the scan table is messed up!
obsc = obsc.avg_coherent(0.0, scan_avg=true)
stimes = pyconvert(Matrix, obsc.scans)
times = pyconvert(Vector, obsc.data["time"])
Expand Down Expand Up @@ -133,9 +132,11 @@ get_bw(obs) = pyconvert(Float64, obs.bw)
Constructs the scan table of a given observation.
"""
function get_scantable(obs)
obs.add_scans()
if PythonCall.Convert.pyisnone(obs.scans)
obs.add_scans()
end
sc = pyconvert(Matrix, obs.scans)
return Table((start=sc[:,1], stop = sc[:,2]))
return ((start=sc[:,1], stop = sc[:,2]))
end


Expand Down

2 comments on commit bb7167c

@ptiede
Copy link
Owner Author

@ptiede ptiede commented on bb7167c Dec 17, 2024

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

  • Updated to eht-imaging 1.2.9 and used that as a lower bound because of critical bug fixes
  • Removed the table dependency

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/121527

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.0 -m "<description of version>" bb7167cd652fb6f41bf4bbaa4e49f084ff08f7c5
git push origin v0.2.0

Please sign in to comment.