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

Wrap histogram #1072

Merged
merged 37 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c042b0a
Add histogram.py
willschlitzer Mar 17, 2021
4409760
remove outfile name
willschlitzer Mar 17, 2021
fe086b3
Update pygmt/src/histogram.py
willschlitzer Mar 17, 2021
da2539f
wrap additional arguments
willschlitzer Mar 18, 2021
f1cbad2
run make format
willschlitzer Mar 18, 2021
c2ec478
Merge branch 'master' into wrap-histogram
willschlitzer Apr 5, 2021
ac99e08
Merge branch 'wrap-histogram' of github.com:GenericMappingTools/pygmt…
willschlitzer Apr 5, 2021
1e0e9aa
add into of docstring for histogram.py
willschlitzer Apr 5, 2021
6ec0a66
add histogram to index.rst
willschlitzer Apr 5, 2021
fb2b4ce
add histogram aliases to docstring
willschlitzer Apr 6, 2021
8899a48
remove uncommon parameters
willschlitzer Apr 8, 2021
d66de75
Merge branch 'master' into wrap-histogram
willschlitzer Apr 8, 2021
d30037c
update docstring for histogram
willschlitzer Apr 8, 2021
b8040ab
add interval
willschlitzer Apr 8, 2021
2439d6a
Add test_histogram.py
willschlitzer Apr 8, 2021
05c005f
add test_histogram.png.dvc
willschlitzer Apr 8, 2021
34af05f
run make format
willschlitzer Apr 8, 2021
1cfac35
add line breaks
willschlitzer Apr 9, 2021
72c022c
add docstrings to test_histogram.py
willschlitzer Apr 9, 2021
14aa960
Merge branch 'master' into wrap-histogram
willschlitzer Apr 9, 2021
c84b008
Merge branch 'master' into wrap-histogram
willschlitzer Apr 10, 2021
b5cf339
Apply suggestions from code review
willschlitzer Apr 12, 2021
780b820
Merge branch 'master' into wrap-histogram
willschlitzer Apr 12, 2021
d9b8e39
remove GMTTempFile
willschlitzer Apr 12, 2021
151d90b
Merge branch 'master' into wrap-histogram
willschlitzer Apr 13, 2021
5ab0e5d
Merge branch 'master' into wrap-histogram
willschlitzer Apr 19, 2021
1bc9300
Merge branch 'master' into wrap-histogram
willschlitzer Apr 20, 2021
6bc7fa2
Merge branch 'master' into wrap-histogram
willschlitzer Apr 24, 2021
69f5d4d
Update pygmt/src/histogram.py
willschlitzer Apr 24, 2021
55c3fbc
update interval parameter to series in test_histogram() in test_histo…
willschlitzer Apr 24, 2021
1d86dc7
update test_histogram.png.dvc
willschlitzer Apr 24, 2021
c914954
run make format
willschlitzer Apr 24, 2021
cb9e25e
Update pygmt/src/histogram.py
willschlitzer Apr 24, 2021
30e2004
Merge branch 'master' into wrap-histogram
willschlitzer Apr 24, 2021
85201e5
add region argument in test_histogram() in test_histogram.py
willschlitzer Apr 26, 2021
9980315
update test_histogram.png.dvc
willschlitzer Apr 26, 2021
f1575f9
Merge remote-tracking branch 'origin/wrap-histogram' into wrap-histogram
willschlitzer Apr 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pygmt/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def _repr_html_(self):
grdcontour,
grdimage,
grdview,
histogram,
image,
inset,
legend,
Expand Down
1 change: 1 addition & 0 deletions pygmt/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from pygmt.src.grdinfo import grdinfo
from pygmt.src.grdtrack import grdtrack
from pygmt.src.grdview import grdview
from pygmt.src.histogram import histogram
from pygmt.src.image import image
from pygmt.src.info import info
from pygmt.src.inset import inset
Expand Down
34 changes: 34 additions & 0 deletions pygmt/src/histogram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
Histogram - Create a histogram
"""
from pygmt.clib import Session
from pygmt.helpers import (
GMTTempFile,
build_arg_string,
fmt_docstring,
kwargs_to_strings,
use_alias,
)


@fmt_docstring
@use_alias(
J="projection",
G="color",
R="region",
)
@kwargs_to_strings(R="sequence")
def histogram(table, **kwargs):
seisman marked this conversation as resolved.
Show resolved Hide resolved
r"""
Histogram
"""
willschlitzer marked this conversation as resolved.
Show resolved Hide resolved
with GMTTempFile() as outfile:
with Session() as lib:
file_context = lib.virtualfile_from_data(data=table)
willschlitzer marked this conversation as resolved.
Show resolved Hide resolved
with file_context as infile:
arg_str = " ".join(
[infile, build_arg_string(kwargs)]
)
lib.call_module("histogram", arg_str)
result = outfile.read()
return result
willschlitzer marked this conversation as resolved.
Show resolved Hide resolved