Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,18 @@ jobs:
using Kezdi
DocMeta.setdocmeta!(Kezdi, :DocTestSetup, :(using Kezdi); recursive=true)
doctest(Kezdi)
trigger-docs-copy:
needs: docs # Ensure this runs after docs job completes
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.DOCS_REPO_ACCESS_TOKEN }}
repository: gergelyattilakiss/docs.koren.dev
event-type: copy-kezdi-docs
client-payload: |
{
"ref": "${{ github.ref }}",
"sha": "${{ github.sha }}"
}
3 changes: 0 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ FreqTables = "da1fdf0e-e0ff-5433-a45f-9bb5ff651cb1"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
ReadStatTables = "52522f7a-9570-4e34-8ac6-c005c74d4b84"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Expand All @@ -33,14 +32,12 @@ FreqTables = "0.4"
InteractiveUtils = "1"
Logging = "1"
Missings = "1"
RDatasets = "0.7"
ReadStatTables = "0.3"
Reexport = "1"
Statistics = "1"
StatsBase = "0.34"
julia = "1.9, 1.10, 1.11"


[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It imports and reexports [CSV](https://csv.juliadata.org/stable/), [DataFrames](

## Getting started

> `Kezdi.jl` is currently in beta. We have more than 500 unit tests and a large code coverage. [![Coverage](https://codecov.io/gh/codedthinking/Kezdi.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/codedthinking/Kezdi.jl) The package, however, is not guaranteed to be bug-free. If you encounter any issues, please report them as a [GitHub issue](https://github.com/codedthinking/Kezdi.jl/issues/new).
> `Kezdi.jl` is currently in beta. We have more than 500 unit tests and a large code coverage. [![Coverage](https://codecov.io/gh/codedthinking/Kezdi.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/codedthinking/Kezdi.jl) The package, however, is not guaranteed to be bug-free. If you encounter any issues, please report them as a [GitHub issue](https://github.com/codedthinking/Kezdi.jl/issues/new). In any case you want to contribute to the software please do it in a form of pull request to the current development branch `0.5-dev`. In case you need support with installation or use please use the discussions forum on github.
>
> If you would like to receive updates on the package, please star the repository on GitHub and sign up for [email notifications here](https://relentless-producer-1210.ck.page/62d7ebb237).

Expand Down Expand Up @@ -217,7 +217,14 @@ To maintain compatibility with Julia, we had to rename some functions. For examp
## Acknowledgements
[^stata]: Stata is a registered trademark of StataCorp LLC. Kezdi.jl is not affiliated with StataCorp LLC.

Inspiration for the package came from [Tidier.jl](https://tidierorg.github.io/Tidier.jl/stable/), a similar package launched by Karandeep Singh that provides a dplyr-like interface for Julia. Johannes Boehm has also developed a similar package, [Douglass.jl](https://github.com/jmboehm/Douglass.jl).
Inspiration for the package came from [Tidier.jl](https://tidierorg.github.io/Tidier.jl/stable/), a similar package launched by Karandeep Singh that provides a dplyr-like interface for Julia. Johannes Boehm has also developed a similar package, [Douglass.jl](https://github.com/jmboehm/Douglass.jl) although our package has a more extensive feature set and is more actively developed. We appreciate both previous work as they showed the possibility for creating and help us in formulating our idea.

A comparison to Douglass.jl:
1. The main difference is between how Douglass and Kezdi process the commands. Douglass uses a string parsing approach where a string using Stata-like syntax, but using Julia conventions for referencing variables in a dataframe, is used to implement the actions on the dataframe whereas Kezdi uses macros and Julia's macro parsing and processing to implement all the actions,
2. Kezdi's reference to dataframe variables is using the Stata convention rather than using Julia symbols,
3. Kezdi has implemented commands for basic analysis of data, matching Stata commands and their syntax,
4. on data manipulation commands both packages have some that the other does not implemented yet,
5. and Douglass has implemented the `by:` and `bysort:` prefixes in general for commands.

The package is built on top of [DataFrames.jl](https://dataframes.juliadata.org/stable/), [FreqTables.jl](https://github.com/nalimilan/FreqTables.jl) and [FixedEffectModels.jl](https://github.com/FixedEffects/FixedEffectModels.jl). The `@with` function relies on [Chain.jl](https://github.com/jkrumbiegel/Chain.jl) by Julius Krumbiegel.

Expand Down
2 changes: 1 addition & 1 deletion src/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ getdf() = _global_dataframe
Set the global data frame.
"""
setdf(df::Union{AbstractDataFrame,Nothing}) = global _global_dataframe = isnothing(df) ? nothing : copy(df)
display_and_return(x) = (display(x); x)
display_and_return(x) = isinteractive() ? (display(x)) : (display(x); x)

"""
distinct(x::AbstractVector) = unique(x)
Expand Down
2 changes: 1 addition & 1 deletion src/side_effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function rewrite(::Val{:regress}, command::Command)
display("Dropping $(sum(.!$additional_condition)) row(s) due to missing values.")
end
if length($(arguments[2:end])) == 1
reg(view($target_df, $additional_condition, :), @formula($(arguments[1]) ~ $(arguments[2])), $vcov) |> $teardown
reg(view($target_df, $additional_condition, :), @formula($(arguments[1]) ~ $(arguments[2])), $vcov) |> Kezdi.display_and_return |> $teardown
else
reg(view($target_df, $additional_condition, :), @formula($(arguments[1]) ~ $(Expr(:call, :+, arguments[2:end]...))), $vcov) |> Kezdi.display_and_return |> $teardown
end
Expand Down
2 changes: 1 addition & 1 deletion test/speed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
end

time = median(t).time / 1e9
@test time < 20.0
@test time < 60.0
end
Loading