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

Potential improvement: work with dicts #6

Open
vankesteren opened this issue Aug 25, 2022 · 0 comments
Open

Potential improvement: work with dicts #6

vankesteren opened this issue Aug 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@vankesteren
Copy link
Owner

ArrayMargins, ArrayFactors are currently objects with two slots:

  • the margins or factors
  • DimIndices

this is pretty similar to just having a dictionary (with some extra sauce). Potentially, dictionaries are the nicer data structure here?

struct ArrayFactors{T} <: AbstractDict{K,V} where K = Vector{Vector{Int}} where V = Vector{<:AbstractArray{T}}

look here:
https://github.com/JuliaLang/julia/blob/master/base/dict.jl#L57-L79

vankesteren added a commit that referenced this issue Aug 25, 2022
@vankesteren vankesteren added the enhancement New feature or request label Aug 26, 2022
vankesteren added a commit that referenced this issue Aug 26, 2022
Big overhaul of the API, but maintaining some of the ease-of-use / qol interface of v0.1.0.

Changelog:

* Add vararg constructor for ArrayFactors

* add convenient method for ipf without seed matrix

as per Agresti, sec. 9.7.2

* Start multidimensional

* progress on multidimensional margins

* Create arraydims and arraymargins structs

* update for arraymargins & rename arraydims

- ArrayDims are now DimIndex (should maybe be DimIndices?)

* arrayfactors for multidim margins

* Add multidim sorting to ArrayFactors

* Refactor DimIndex -> DimIndices

* make arraymargins sorted constructor

* Update DimIndices

- add uniqueness check
- add docs
- update issorted method

* Clean up array margins

- Fix reference to DimIndices in docs
- Add size method
- Remove buggy sorting stuff

* update ArrayFactors

- Find failure
- remove weird sorting code

* Fix ArrayFactors Array method

- Now works with arbitrary DimIndices
- Fixed the size method
- Also fixed the size method for ArrayMargins

* small doc fix arrayfactors

* Make DimIndices consistent nested int vector

* Update tests

- add DimIndices tests
- add ArrayMargins tests
- overhaul ArrayFactors tests

* add todo in arrayfactors

* ipf_mult deals with ArrayMargins and DimIndices

- also add getindex method for dimindices

* Small fix for multidimensional arraymargins

* start update for multidimensional ipf

* first working version of multidimensional ipf

- also update to julia 1.8.0

* Add dict methods for AF & AM

preparation for #6

* Remove DimIndices convenience methods

* Merge api for nultidimensional with ipf

- remove original ipf
- add convenience interface for new ipf
- adjust tests
- move consistency tests to ArrayMargins

* update new interface

- Add consistency checks to test
- Add margin transform to export
- Fix small bug with inconsistent margin info message

* Update docs manifest

* Update benchmarks.md

The new algorithm is quite a bit faster!

* Update documentation, bump version

* Add constructor for mixed-eltype ArrayFactors

* change devbranch in documentation to "dev"

* Clean up constructors for types

- Move getdims to default_dimindices in DimIndices file
- Adjust tests for new constructor setup

* Small fixes for constructors in AF & AM docs

* final small doc update

* Disable info logging in tests

For cleaner test output

* Remove logging disable again

* Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant