Skip to content

Commit

Permalink
rename Grow to Vec & Compact to Dense
Browse files Browse the repository at this point in the history
----

- fix DataLine
-
  - Dense
  - Grow
  - Buffer (FUTURE)
  - export dense from all
  - export copy?

- add an crate error type for all kinds of data errors

- Make DataTable
- Make DataFrame
- Make DataGrid
  - MOVE Grid2d here and generalize with the builder

- Simplify
  - MAYBE remove `fugit`, and time? replace with espera
    - in `espera` add smaller sized times, with clear time limits, dimensioned
    - together with maybe traits to convert from one another (as counters…)

----

# IDEAS WORKS

- check features:
  - https://docs.rs/crate/half/2.0.0/features
  - https://docs.rs/crate/half/2.0.0/features

=MAYBE
- separate lines & units into a different module (for docs)

- MAYBE? rename traits to singular word

- [ ] CHECK changes on macros
  - [ ] define_single_sice:DataBare noncopy
  - [ ] use Manually Drop
- [ ] WIP rename traits (no final s)
- [ ] update lib dics

-----
- DESIGN:
- MAYBE simplify :)
- MAYBE return when rust 1.65 comes

----

--------

↓MAYBE
- add new char array type

- support posits from
  - https://github.com/rust-amplify/rust-amplify

----------------
:WIP improve DataBare

- mark: `WIP:databare`
- MAYBE work in a different feature branch?
- TODO:
  - allow With variant
  - allow non-Copy

# RETHINK DataCell
  - modify DataCell to include a DataTypes phantom Data?
    - should be a struct

--------------

- add serialization, Serde & arkiv
  ```
  #[cfg(feature = "serde")]
  #[macro_use]
  extern crate serde;
  more alternatives :) (name?)
  ```
  - https://davidkoloski.me/blog/rkyv-is-faster-than/

- automatically implement Read & Write for DataCells !!
  - bluss/arrayvec#199

  - MAYBE for DataCellUnsafe? (& DataType?)
  - CLARIFY differences with serialization, or could share common ground?
    - decide whether to
  automatically derive Write for Vec<DataTypes>

- add `unsafe_cell` example. WIP
- add dev dependency `static_assertions`. WIP
  - MAYBE update tests WIP

- include specific implementations From DataType to DataCell when implements `Default`
  - (or consider whether require the `Default` trait (similar case to `Debug`)

----

# TODO !
  - una macro o método sencillo para crear tipos personalizados
  (incluyendo opcionalmente un datatype…) ?
  con tal de que implemente DataTypes...

---------------

  MAYBE
- don't move column & row into series (what are their characteristics anyway?
  I alreadu

- DataClass trait (related with ±nested?)
	- is_categorical? None -> false
	- is_numerical? None -> false

# crates

- MAYBE https://crates.io/crates/takeable/0.2.0
  - https://www.reddit.com/r/rust/comments/y5q6ac/taking_ownership_of_structure_fields_inside/
  • Loading branch information
joseluis committed Dec 11, 2022
1 parent db73875 commit 78af908
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
32 changes: 16 additions & 16 deletions src/builder/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1542,42 +1542,42 @@ macro_rules! define_line {
// WIP:DATALINE
// type_aliases![l: $tname, size: $B, $b, "Copy", "data **Type**", "(Copy)" ];

// DEFINE DataLineGrow*
// DEFINE DataLineVec*

// vec, Copy
#[doc = "A **vector** of [`"
[< $cname $B Byte Copy With >] "`][crate::all::" [< $cname $B Byte Copy With >] "]" ]
#[cfg(feature = "std" )]
#[derive(Clone, Debug)]
pub struct [< DataLineGrow $B Byte Copy With >]<C: DataCellCopy> {
pub struct [< DataLineVec $B Byte Copy With >]<C: DataCellCopy> {
cells: Vec<[< $cname $B Byte Copy With >]<C>>
}
// vec, Copy, non-With
#[cfg(feature = "std" )]
#[doc = "A **vector** of [`" [< $cname $B Byte Copy >] "`][crate::all::" [< $cname $B Byte Copy >] "]" ]
pub type [< DataLineGrow $B Byte Copy >] = [< DataLineGrow $B Byte Copy With >]<()>;
pub type [< DataLineVec $B Byte Copy >] = [< DataLineVec $B Byte Copy With >]<()>;

// vec, non-Copy
#[cfg(feature = "std" )]
#[doc = "A **vector** of [`"
[< $cname $B Byte Copy With >] "`][crate::all::" [< $cname $B Byte With >] "]" ]
#[derive(Debug)]
pub struct [< DataLineGrow $B Byte With >]<C: DataCell> {
pub struct [< DataLineVec $B Byte With >]<C: DataCell> {
cells: Vec<[< $cname $B Byte With >]<C>>
}
// vec, non-Copy, non-With
#[cfg(feature = "std" )]
#[doc = "A **vector** of [`" [< $cname $B Byte>] "`][crate::all::" [< $cname $B Byte >] "]" ]
pub type [< DataLineGrow $B Byte >] = [< DataLineGrow $B Byte With >]<()>;
pub type [< DataLineVec $B Byte >] = [< DataLineVec $B Byte With >]<()>;

// DEFINE DataLineCompact*
// DEFINE DataLineDense*

// compact array, Copy
#[doc = "A dense **array** of [`"
[< $bname $B Byte Copy >] "`][crate::all::" [< $bname $B Byte Copy >] "]\n" ]
///
#[derive(Clone, Copy, Debug)]
pub struct [< DataLineCompact $B Byte Copy >]<const LEN: usize> {
pub struct [< DataLineDense $B Byte Copy >]<const LEN: usize> {
// WIP
_types: [[< $tname $B Byte Copy >]; LEN],
_cells: [[< $bname $B Byte Copy >]; LEN]
Expand Down Expand Up @@ -1616,31 +1616,31 @@ macro_rules! define_line {

// From/Into Vec, Copy
#[cfg(feature = "std" )]
impl<C: DataCellCopy> From< [<DataLineGrow $B Byte Copy With>]<C> > for Vec< [<$cname $B Byte Copy With>]<C> > {
fn from(from: [<DataLineGrow $B Byte Copy With>]<C>) -> Self {
impl<C: DataCellCopy> From< [<DataLineVec $B Byte Copy With>]<C> > for Vec< [<$cname $B Byte Copy With>]<C> > {
fn from(from: [<DataLineVec $B Byte Copy With>]<C>) -> Self {
from.cells
}
}
#[cfg(feature = "std" )]
impl<C: DataCellCopy> From< Vec<[<$cname $B Byte Copy With>]<C>> > for [<DataLineGrow $B Byte Copy With>]<C> {
impl<C: DataCellCopy> From< Vec<[<$cname $B Byte Copy With>]<C>> > for [<DataLineVec $B Byte Copy With>]<C> {
fn from(from: Vec< [<$cname $B Byte Copy With>]<C> > ) -> Self {
[<DataLineGrow $B Byte Copy With>] {
[<DataLineVec $B Byte Copy With>] {
cells: from
}
}
}

// From/Into Vec, non-Copy
#[cfg(feature = "std" )]
impl<C: DataCell> From< [<DataLineGrow $B Byte With>]<C> > for Vec< [<$cname $B Byte With>]<C> > {
fn from(from: [<DataLineGrow $B Byte With>]<C>) -> Self {
impl<C: DataCell> From< [<DataLineVec $B Byte With>]<C> > for Vec< [<$cname $B Byte With>]<C> > {
fn from(from: [<DataLineVec $B Byte With>]<C>) -> Self {
from.cells
}
}
#[cfg(feature = "std" )]
impl<C: DataCell> From< Vec<[<$cname $B Byte With>]<C>> > for [<DataLineGrow $B Byte With>]<C> {
impl<C: DataCell> From< Vec<[<$cname $B Byte With>]<C>> > for [<DataLineVec $B Byte With>]<C> {
fn from(from: Vec< [<$cname $B Byte With>]<C> > ) -> Self {
[<DataLineGrow $B Byte With>] {
[<DataLineVec $B Byte With>] {
cells: from
}
}
Expand Down Expand Up @@ -1978,7 +1978,7 @@ macro_rules! reexport {
(@Line $path:path; size: $size:literal; $( $suf:ident )+ ) => {
$crate::reexport![@ $path; DataLine; size: $size ; $( $suf )+ ];
#[cfg(feature = "std" )]
$crate::reexport![@ $path; DataLineGrow; size: $size ; $( $suf )+ ];
$crate::reexport![@ $path; DataLineVec; size: $size ; $( $suf )+ ];
};

// generic re-export
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
//!
//! The fundamental linear abstractions are:
//! - `DataLine…` structs, based on an array `[DataCell*; const usize]`.
//! - `DataLineGrow…` structs, growable, based on a vector `Vec<DataCell*>`.
//! - `DataLineCompact*…` structs, uses `DataBare*` plus `DataType*`.
//! - `DataLineVec…` structs, growable, based on a vector `Vec<DataCell*>`.
//! - `DataLineDense*…` structs, uses `DataBare*` plus `DataType*`.
//!
//! ## External dependencies
//!
Expand Down Expand Up @@ -234,7 +234,7 @@ pub mod units {
///
/// The concrete implementations of **linear types** observes the following naming schema:
/// ```txt
/// -) Data Line [Grow] [Dense|Buffer] <Size> [Copy] [With] Legend | Sizes
/// -) Data Line [Vec] [Dense|Buffer] <Size> [Copy] [With] Legend | Sizes
/// --------------- | -------------
/// <> : required | 1B = 8b
/// [] : optional | 2B = 16b
Expand Down

0 comments on commit 78af908

Please sign in to comment.