Skip to content

Commit

Permalink
updated the DatasetSimple, Shapefile, TimeSeriesTableFull, and TimeSe…
Browse files Browse the repository at this point in the history
…riesTableFullTimeSeriesInner functions.
  • Loading branch information
00krishna committed Jul 20, 2024
1 parent e1487e2 commit 374d564
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 41 deletions.
6 changes: 3 additions & 3 deletions src/models/model_DatasetSimple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ group, and sequence.
# Arguments
- `name::String`- **(Optional)** The dataset identifier
- `description::String`-(Optional) A short description of the dataset
- `group::String`-(Optional) The group of datasets to which this dataset belongs.
- `sequence::Int64`-(Optional) The order in which the dataset will appear in the metadata API and extracts.
- `description::String`- **(Optional)** A short description of the dataset
- `group::String`- **(Optional)** The group of datasets to which this dataset belongs.
- `sequence::Int64`- **(Optional)** The order in which the dataset will appear in the metadata API and extracts.
# Returns
Expand Down
30 changes: 19 additions & 11 deletions src/models/model_Shapefile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,34 @@ Shapefile(;
sequence=nothing,
)
```
This function creates a representation for geographic information systems (GIS) files.
This function creates a reference to an NHGIS shapefile for an IPUMS dataset.
# Attributes
- `name::String`-The unique identifier of the shapefile.
- `year::String`-The survey year in which the file's represented areas were used for tabulations.
- `geographicLevel::String`-The geographic level of the shapefile.
- `extent::String`-The geographic extent which is covered by the shapefile.
- `basis::String`-The derivation source of the shapefile.
- `sequence::Int64`- The order the shapefile in which appears in the metadata API.
- `name::String`- **(Optional)** The unique identifier of the shapefile.
- `year::String`- **(Optional)** The survey year in which the file's represented areas were used for tabulations.
- `geographicLevel::String`- **(Optional)** The geographic level of the shapefile.
- `extent::String`- **(Optional)** The geographic extent which is covered by the shapefile.
- `basis::String`- **(Optional)** The derivation source of the shapefile.
- `sequence::Int64`- **(Optional)** The order the shapefile in which appears in the metadata API.
# Returns
It returns a list of all the available shapefile.
This function returns a Shapefile object containing the attributes specified in
the function arguments.
# Examples
```julia-repl
julia> IPUMS.Shapefile(name = "base.tl2000.nongen.us_state_1790", year = "1790", geographicLevel = "state", extent = "united states", basis = "2000 tiger/line +", sequence = 1)
julia> IPUMS.Shapefile(name = "base.tl2000.nongen.us_state_1790",
year = "1790",
geographicLevel = "state",
extent = "united states",
basis = "2000 tiger/line +",
sequence = 1)
# Output
{
"name": "base.tl2000.nongen.us_state_1790",
"year": "1790",
Expand All @@ -43,8 +52,7 @@ julia> IPUMS.Shapefile(name = "base.tl2000.nongen.us_state_1790", year = "1790",
```
# References
To find out more about the Shapefile type visit :
* https://developer.ipums.org/docs/v2/workflows/explore_metadata/nhgis/shapefiles/
Additional information about this object is available in the [IPUMS Developer Docs](https://developer.ipums.org/docs/v2/workflows/explore_metadata/nhgis/shapefiles/)
"""
Base.@kwdef mutable struct Shapefile <: OpenAPI.APIModel
name::Union{Nothing, String} = nothing
Expand Down
48 changes: 29 additions & 19 deletions src/models/model_TimeSeriesTableFull.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,40 @@ TimeSeriesTableFull(;
geogLevels=nothing,
)
```
This function creates a table record for the `TimeSeriesTableFull`.
This function returns an object containing the attributes for downloading a
Time Series Table.
# Arguments
- `name::String`- The unique variable identifier for the time series table, (eg. "A00", "OWNERSHP").
- `description::String`- A short description of the time series variable referred to in `name`.
- `geographicIntegration::String`- How does the variable value account for changes in geographic boundaries over time, (eg. "Nominal").
- `sequence::Float32`- The order of appearence of the dataset in the metadata API and extract.
- `timeSeries::Vector{TimeSeriesTableFullTimeSeriesInner}`- A list of time series records corresponding to the variable specified in `name`.
- `geogLevels::Vector{TimeSeriesTableFullTimeSeriesInner}`- A list of geographic levels available for this time series table.
- `name::String`- **(Optional)** The unique variable identifier for the time series table, (eg. "A00", "OWNERSHP").
- `description::String`- **(Optional)** A short description of the time series variable referred to in `name`.
- `geographicIntegration::String`- **(Optional)** Specifies how the variable accounts for changes in geographic boundaries over time, (eg. "Nominal").
- `sequence::Float32`- **(Optional)** The order of appearence of the dataset in the metadata API and extract.
- `timeSeries::Vector{TimeSeriesTableFullTimeSeriesInner}`- **(Optional)** A list of time series records corresponding to the variable specified in `name`.
- `geogLevels::Vector{TimeSeriesTableFullTimeSeriesInner}`- **(Optional)** A list of geographic levels available for this time series table.
# Returns
The return is a new record for the `TimeSeriesTableFull` containing the variable name, description, time series, and geographical information of the data.
This function return a `TimeSeriesTableFull` object containing the variable
name, description, time series, and geographical information of the data.
# Examples
```julia-repl
julia> IPUMS.TimeSeriesTableFull(name="A00", description= "Total Population",
julia> IPUMS.TimeSeriesTableFull(name="A00",
description= "Total Population",
geographicIntegration= "Nominal",
sequence= 0.01,
timeSeries=[Dict("name" => "AA", "description" => "Persons: Total", "sequence" => 1 )],
geogLevels= [ Dict( "name" => "state", "description" => "State", "sequence" => 4 ),
Dict( "name" => "county", "description" => "State--County", "sequence" => 25 ) ])
timeSeries=[IPUMS.TimeSeriesTableFullTimeSeriesInner(name = "AA",
description = "Persons: Total",
sequence = 1 )],
geogLevels= [ IPUMS.TimeSeriesTableFullTimeSeriesInner(name = "state",
description = "State",
sequence = 4 ),
IPUMS.TimeSeriesTableFullTimeSeriesInner(name = "county",
description = "State--County",
sequence = 25 )])
# Output
{
"name": "A00",
"description": "Total Population",
Expand All @@ -46,23 +55,24 @@ julia> IPUMS.TimeSeriesTableFull(name="A00", description= "Total Population",
"timeSeries": [
{
"name": "AA",
"sequence": 1,
"description": "Persons: Total"
"description": "Persons: Total",
"sequence": 1
}
],
"geogLevels": [
{
"name": "state",
"sequence": 4,
"description": "State"
"description": "State",
"sequence": 4
},
{
"name": "county",
"sequence": 25,
"description": "State--County"
"description": "State--County",
"sequence": 25
}
]
}
```
# References
Expand Down
21 changes: 13 additions & 8 deletions src/models/model_TimeSeriesTableFullTimeSeriesInner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,27 @@ TimeSeriesTableFullTimeSeriesInner(;
)
```
Inner constructor representing the variables within a TimeSeriesTableFull object
This function creates a reference to an IPUMS Time Series table.
# Arguments
- `name::String`- The unique identifier of the time series table.
- `description::String`- A short description of the time series table.
- `sequence::Int64`- The order in which the time series table will appear in the metadata API and extracts.
- `name::String`- **(Optional)** The unique identifier of the time series table.
- `description::String`- **(Optional)** A short description of the time series table.
- `sequence::Int64`- **(Optional)** The order in which the time series table will appear in the metadata API and extracts.
# Returns
This returns an inner constructor.
This function returns a `TimeSeriesTableFullTimeSeriesInner` object that contains
information about a desired Time Series table.
# Examples
```julia-repl
julia> IPUMS.TimeSeriesTableFullTimeSeriesInner(name = "1790_cPop", description = "1790 Census: Population Data [US, States & Counties]", sequence = 101)
julia> IPUMS.TimeSeriesTableFullTimeSeriesInner(name = "1790_cPop",
description = "1790 Census: Population Data [US, States & Counties]",
sequence = 101)
# Output
{
"name": "1790_cPop",
"description": "1790 Census: Population Data [US, States & Counties]",
Expand All @@ -35,8 +40,8 @@ julia> IPUMS.TimeSeriesTableFullTimeSeriesInner(name = "1790_cPop", description
```
# References
To find out more about the TimeSeriesTableFullTimeSeriesInner visit:
* https://developer.ipums.org/docs/v2/workflows/explore_metadata/nhgis/time_series/
Additional information about the `TimeSeriesTableFullTimeSeriesInner`object is available in the [IPUMS Developer Docs](https://developer.ipums.org/docs/v2/workflows/explore_metadata/nhgis/time_series/)
"""
Base.@kwdef mutable struct TimeSeriesTableFullTimeSeriesInner <: OpenAPI.APIModel
name::Union{Nothing, String} = nothing
Expand Down

0 comments on commit 374d564

Please sign in to comment.