6 #ifndef TURI_UNITY_GL_SARRAY_HPP 7 #define TURI_UNITY_GL_SARRAY_HPP 13 #include <core/storage/sframe_data/sframe_rows.hpp> 14 #include <core/storage/sframe_data/group_aggregate_value.hpp> 15 #include <core/data/flexible_type/flexible_type.hpp> 16 #include <visualization/server/plot.hpp> 25 class unity_sarray_base;
27 class gl_sarray_range;
222 explicit gl_sarray(
const std::string& directory);
243 void construct_from_vector(
const std::vector<flexible_type>& values,
262 gl_sarray(
const std::initializer_list<flexible_type>& values);
321 gl_sarray(std::shared_ptr<unity_sarray_base> sarray);
331 operator std::shared_ptr<unity_sarray>()
const;
336 operator std::shared_ptr<unity_sarray_base>()
const;
342 std::shared_ptr<sarray<flexible_type> > materialize_to_sarray()
const;
560 std::function<
bool(
size_t,
const std::shared_ptr<sframe_rows>&)> callback,
561 size_t nthreads = (
size_t)(-1));
628 void save(
const std::string& directory,
const std::string& format=
"binary")
const;
754 bool to_lower=
true,
bool ignore_space=
true)
const;
779 bool exclude=
true)
const;
950 bool skip_undefined=
true)
const;
985 bool skip_undefined=
true)
const;
1268 bool undefined_on_failure=
true)
const;
1543 const std::vector<std::string>& limit = {
"year",
"month",
"day",
"hour",
"minute",
"second"},
1544 bool tzone=
false)
const;
1661 const std::vector<flex_type_enum>& column_types = std::vector<flex_type_enum>(),
1663 const std::vector<flexible_type>& limit = std::vector<flexible_type>())
const;
1775 std::shared_ptr<group_aggregate_value> aggregator)
const;
1776 gl_sarray builtin_cumulative_aggregate(
const std::string& name)
const;
1849 size_t min_observations=
size_t(-1))
const;
1865 virtual std::shared_ptr<unity_sarray>
get_proxy()
const;
1868 void instantiate_new();
1870 void ensure_has_sarray_reader()
const;
1872 std::shared_ptr<unity_sarray> m_sarray;
1874 mutable std::shared_ptr<sarray_reader<flexible_type> > m_sarray_reader;
1915 size_t start,
size_t end);
1923 public boost::iterator_facade<iterator,
1924 const flexible_type, boost::single_pass_traversal_tag> {
1934 friend class boost::iterator_core_access;
1936 void advance(
size_t n);
1937 inline bool equal(
const iterator& other)
const {
1938 return m_counter == other.m_counter;
1940 const type& dereference()
const;
1941 size_t m_counter = 0;
1967 std::shared_ptr<sarray_reader_buffer<flexible_type> > m_sarray_reader_buffer;
1978 class gl_sarray_writer_impl;
2071 template <
typename T>
2072 void write(T begin, T end,
size_t segmentid) {
2073 while (begin != end) {
2074 write((*begin), segmentid);
2088 size_t num_segments()
const;
2093 std::unique_ptr<gl_sarray_writer_impl> m_writer_impl;
gl_sarray astype(flex_type_enum dtype, bool undefined_on_failure=true) const
size_t num_missing() const
gl_sarray append(const gl_sarray &other) const
gl_sarray()
Constructs an empty SArray.
void save(const std::string &directory, const std::string &format="binary") const
gl_sarray dict_trim_by_values(const flexible_type &lower=FLEX_UNDEFINED, const flexible_type &upper=FLEX_UNDEFINED) const
gl_sarray clip_upper(flexible_type threshold) const
void write(T begin, T end, size_t segmentid)
static gl_sarray from_sequence(size_t start, size_t end, bool reverse=false)
gl_sarray apply(std::function< flexible_type(const flexible_type &)> fn, flex_type_enum dtype, bool skip_undefined=true) const
gl_sarray dict_values() const
gl_sarray fillna(flexible_type value) const
flexible_type std() const
gl_sarray hash(size_t seed=0) const
gl_sarray sort(bool ascending=true) const
gl_sarray filter(std::function< bool(const flexible_type &)> fn, bool skip_undefined=true) const
std::set< Key > keys(const std::map< Key, T > &map)
gl_sarray clip_lower(flexible_type threshold) const
flexible_type operator[](int64_t i) const
static std::ostream & operator<<(std::ostream &out, const uint128_t &x)
Enables printing of uint128_t values.
iterator const_iterator
const_iterator type
flexible_type min() const
flex_type_enum infer_type_of_list(const std::vector< flexible_type > &vec)
flexible_type max() const
gl_sarray datetime_to_str(const std::string &str_format="%Y-%m-%dT%H:%M:%S%ZP") const
gl_sarray cumulative_sum() const
gl_sarray builtin_rolling_apply(const std::string &fn_name, ssize_t start, ssize_t end, size_t min_observations=size_t(-1)) const
gl_sarray dict_trim_by_keys(const std::vector< flexible_type > &keys, bool exclude=true) const
std::shared_ptr< visualization::Plot > plot(const flexible_type &title, const flexible_type &xlabel, const flexible_type &ylabel) const
gl_sarray clip(flexible_type lower=FLEX_UNDEFINED, flexible_type upper=FLEX_UNDEFINED) const
gl_sarray item_length() const
virtual std::shared_ptr< unity_sarray > get_proxy() const
gl_sarray dict_keys() const
gl_sarray pixel_array_to_image(size_t width, size_t height, size_t channels=3, bool undefined_on_failure=true) const
gl_sarray & operator=(const gl_sarray &)
Copy Assignment.
gl_sarray contains(const flexible_type &other) const
gl_sframe split_datetime(const std::string &column_name_prefix="X", const std::vector< std::string > &limit={"year","month","day","hour","minute","second"}, bool tzone=false) const
void show(const std::string &path_to_client, const flexible_type &title, const flexible_type &xlabel, const flexible_type &ylabel) const
gl_sarray tail(size_t n) const
static gl_sarray from_const(const flexible_type &value, size_t size)
gl_sarray count_words(bool to_lower=true, turi::flex_list delimiters={"\, "\", "\", "\", "\", " "}) const
gl_sarray sample(double fraction) const
gl_sarray topk_index(size_t topk=10, bool reverse=false) const
flexible_type type
content type
gl_sarray dict_has_any_keys(const std::vector< flexible_type > &keys) const
gl_sarray str_to_datetime(const std::string &str_format="%Y-%m-%dT%H:%M:%S%ZP") const
gl_sarray_range range_iterator(size_t start=0, size_t end=(size_t)(-1)) const
std::set< T > values(const std::map< Key, T > &map)
flexible_type sum() const
static gl_sarray read_json(const std::string &url)
gl_sarray head(size_t n) const
gl_sarray dict_has_all_keys(const std::vector< flexible_type > &keys) const
gl_sframe unpack(const std::string &column_name_prefix="X", const std::vector< flex_type_enum > &column_types=std::vector< flex_type_enum >(), const flexible_type &na_value=FLEX_UNDEFINED, const std::vector< flexible_type > &limit=std::vector< flexible_type >()) const
void materialize_to_callback(std::function< bool(size_t, const std::shared_ptr< sframe_rows > &)> callback, size_t nthreads=(size_t)(-1))
gl_sarray subslice(flexible_type start=FLEX_UNDEFINED, flexible_type stop=FLEX_UNDEFINED, flexible_type step=FLEX_UNDEFINED) const
gl_sarray count_ngrams(size_t n=2, std::string method="word", bool to_lower=true, bool ignore_space=true) const
static flexible_type FLEX_UNDEFINED
flexible_type mean() const
flex_type_enum dtype() const
std::vector< flexible_type > flex_list
bool is_materialized() const
gl_sarray cumulative_aggregate(std::shared_ptr< group_aggregate_value > aggregator) const