Use another function in the same module

module ABC
  function F_1(a:Int,b:Int)
    return a + b  
  end

  function F_2(c:Int, d:Int)
    result = F_1(c+3,d+c)
    return result
  end 
end

e.g. Main.ABC.F_2(3,4) will have an error because F_1 cannot be called in F_2. Any suggestions that using another function inside a function within the same module? Thanks

the trait of your function is wrong, : => ::

julia> module ABC
         function F_1(a::Int,b::Int)
           return a + b  
         end

         function F_2(c::Int, d::Int)
           result = F_1(c+3,d+c)
           return result
         end 
       end
Main.ABC

julia> Main.ABC.F_2(3,4)
13

Sorry for the mistakes of my example, thanks for pointing out the mistake of the trait. After correcting it, my example works.
But I don’t know why my following case has the problem:


module features_engineering
    using DataFrames
    function map_atom_info(df::DataFrame, structures::DataFrame,atom_idx::Int)
       df = join(df,structures,on = [(:molecule_name,:molecule_name),(Symbol("atom_index_$(atom_idx)"), :atom_index)],kind = :outer)
       delete!(df,"atom_idx")
       rename!(df, Dict(:atom =>Symbol("atom_$atom_idx"),
                        :x => :Symbol("x_$atom_idx"),
                        :y => Symbol("y_$atom_idx"),
                        :z => Symbol("z_$atom_idx")))
       return df
    end

    function distance_type_feat(train::DataFrame,test::DataFrame,structures::DataFrame)
        train = map_atom_info(train,structures, 0)
        train = map_atom_info(train,structures, 1)
        test = map_atom_info(test,structures, 0)
        test = map_atom_info(test,structures, 1)

        train_p_0 = train[[:x_0,:y_0,:z_0]]
        train_p_1 = train[[:x_1, :y_1, :z_1]]
        test_p_0 = test[[:x_0, :y_0, :z_0]]
        test_p_1 = test[[:x_1, :y_1, :z_1]]

        train[:dist] = norm(train_p_0 - train_p_1)
        test[:dist]  = norm(test_p_0 - test_p_1)
        train[:dist_x] = (train[:x_0] - train[:x_1]) ^ 2
        test[:dist_x] = (test[:x_0] - test[:x_1]) ^ 2
        train[:dist_y] = (train[:y_0] - train[:y_1]) ^  2
        test[:dist_y] = (test[:y_0] - test[:y_1]) ^ 2
        train[:dist_z] = (train[:z_0] - train[:z_1]) ^ 2
        test[:dist_z] = (test[:z_0] - test[:z_1]) ^ 2

        function substring_(x::String,i::Int)
            if i==1
                return string(x[1])
            elseif i==2
                return x[2:end]
            else
                return "NA"
            end
        end

        train[:type_0] = substring_.(train[:type],1)
        test[:type_0] = substring_.(test[:type],1)
        train[:type_1] = substring_.(train[:type],2)
        test[:type_1] = substring_.(test[:type],2)
        return train,test
    end
end

MethodError: no method matching join(::DataFrame, ::Tuple{Symbol,Symbol}; on=(:molecule_name, :molecule_name), kind=:outer)
Closest candidates are:
join(::Any, ::Any) at strings/io.jl:277 got unsupported keyword arguments “on”, “kind”
join(::Any, ::Any, !Matched::Any) at strings/io.jl:278 got unsupported keyword arguments “on”, “kind”
join(!Matched::IO, ::Any) at strings/io.jl:269 got unsupported keyword arguments “on”, “kind”

map_atom_info(::DataFrame, ::DataFrame, ::Int64) at PMP_20190708.jl:17
distance_type_feat(::DataFrame, ::DataFrame, ::DataFrame) at PMP_20190708.jl:27
top-level scope at none:0

it says, there’s no keyword kind for the .join() function, where are you getting this usage of the function?

I should have used “join” function improperly. Anyway this is out of scope of the question. Your first response has been the solution of the question already.