# Reexporting problem types

**URL:** <https://discourse.julialang.org/t/reexporting-problem-types/5650>\
**Category:** General Usage\
**Tags:** question, module, design\
**Created:** [August 31, 2017, 5:00am UTC](https://discourse.julialang.org/t/reexporting-problem-types/5650 "2017-08-31T05:00:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 31, 2017, 5:00am UTC](https://discourse.julialang.org/t/reexporting-problem-types/5650/1 "2017-08-31T05:00:05Z")

</div>

Inspired by the JuliaDiffEq ecosystem and many other awesome Julia frameworks, I am trying to split my package into a Base package that contains the problem definitions and solution specifications. I have finished a first implementation here: [https://github.com/juliohm/GeoStatsBase.jl](https://github.com/juliohm/GeoStatsBase.jl)

Now my question is how to **use** the concepts in the base package in the implementation packages. For instance, I tried to simply do the following in GeoStats.jl:

```julia
module GeoStats

using Reexport

# load problem and solution specifications
@reexport using GeoStatsBase

# instantiate concrete problems defined in GeoStatsBase
EstimationProblem(somedata, somedomain, somevars)

end # module

```

The module compiles fine, but when I run the tests, whenever the constructor of EstimationProblem is called, I get the following error:

```julia
Estimation: Error During Test
  Got an exception of type ErrorException outside of a @test
  not implemented
  Stacktrace:
   [1] Type at /home/juliohm/.julia/v0.6/GeoStatsBase/src/problems/estimation_problem.jl:44 [inlined]
   [2] GeoStatsBase.EstimationProblem(::GeoStats.GeoDataFrame{DataFrames.DataFrame}, ::GeoStats.RegularGrid{Float64,3}, ::Symbol) at /home/juliohm/.julia/v0.6/GeoStatsBase/src/problems/estimation_problem.jl:50
   [3] macro expansion at /home/juliohm/.julia/v0.6/GeoStats/test/problems.jl:6 [inlined]
   [4] macro expansion at ./test.jl:860 [inlined]
   [5] macro expansion at /home/juliohm/.julia/v0.6/GeoStats/test/problems.jl:5 [inlined]
   [6] macro expansion at ./test.jl:860 [inlined]
   [7] anonymous at ./<missing>:?
   [8] include_from_node1(::String) at ./loading.jl:569
   [9] include(::String) at ./sysimg.jl:14
   [10] macro expansion at /home/juliohm/.julia/v0.6/GeoStats/test/runtests.jl:48 [inlined]
   [11] anonymous at ./<missing>:?
   [12] include_from_node1(::String) at ./loading.jl:569
   [13] include(::String) at ./sysimg.jl:14
   [14] process_options(::Base.JLOptions) at ./client.jl:305
   [15] _start() at ./client.jl:371

```

What I am missing?

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 31, 2017, 1:09pm UTC](https://discourse.julialang.org/t/reexporting-problem-types/5650/2 "2017-08-31T13:09:21Z")

</div>

I was missing some imports, it is almost there…

Regarding this specific issue of a Base package that contains concrete problem types and other abstract types, what are the necessary statements to load the package?

```julia
using GeoStatsBase # brings names into scope for usage
import GeoStatsBase: coordinates, npoints, ... # extend interface with new methods

```

In my case, the `data` method for the concrete type `EstimationProblem` is not visible inside of GeoStats, I had to explicitly call `using GeoStatsBase: data` in order to bring it to scope, what is the reason?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 31, 2017, 1:25pm UTC](https://discourse.julialang.org/t/reexporting-problem-types/5650/3 "2017-08-31T13:25:44Z")

</div>

It’s not `export`ed?

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 31, 2017, 5:09pm UTC](https://discourse.julialang.org/t/reexporting-problem-types/5650/4 "2017-08-31T17:09:09Z")

</div>

You mean I should reexport it in GeoStats so that it becomes visible in the tests, makes sense! Looking at it again…
