Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
1500e4f3
Commit
1500e4f3
authored
10 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug on freevar
parent
913d16ec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
+6
-6
6 additions, 6 deletions
.../scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
with
6 additions
and
6 deletions
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
+
6
−
6
View file @
1500e4f3
...
...
@@ -21,9 +21,9 @@ import nl.lumc.sasc.biopet.utils.ConfigUtils.ImplicitConversions
trait
Configurable
extends
ImplicitConversions
{
val
root
:
Configurable
def
configPath
:
List
[
String
]
=
if
(
root
!=
null
)
root
.
configFullPath
else
List
()
protected
lazy
val
configName
=
getClass
.
getSimpleName
.
toLowerCase
protected
lazy
val
configFullPath
=
config
Name
::
config
Path
lazy
val
configPath
:
List
[
String
]
=
if
(
root
!=
null
)
root
.
configFullPath
else
List
()
protected
[
config
]
lazy
val
configName
=
getClass
.
getSimpleName
.
toLowerCase
protected
[
config
]
lazy
val
configFullPath
:
List
[
String
]
=
config
Path
:
::
config
Name
::
Nil
var
defaults
:
scala.collection.mutable.Map
[
String
,
Any
]
=
if
(
root
!=
null
)
scala
.
collection
.
mutable
.
Map
(
root
.
defaults
.
toArray
:
_
*
)
else
scala
.
collection
.
mutable
.
Map
()
...
...
@@ -32,7 +32,7 @@ trait Configurable extends ImplicitConversions {
protected
class
ConfigFunctions
{
def
apply
(
key
:
String
,
default
:
Any
=
null
,
submodule
:
String
=
null
,
required
:
Boolean
=
false
,
freeVar
:
Boolean
=
true
)
:
ConfigValue
=
{
val
m
=
if
(
submodule
!=
null
)
submodule
else
configName
val
p
=
(
if
(
submodule
!=
null
)
configName
::
configPath
else
configPath
)
.
reverse
val
p
=
(
if
(
submodule
!=
null
)
configName
::
configPath
else
configPath
)
val
d
=
{
val
value
=
Config
.
getValueFromMap
(
defaults
.
toMap
,
ConfigValueIndex
(
m
,
p
,
key
,
freeVar
))
if
(
value
.
isDefined
)
value
.
get
.
value
else
default
...
...
@@ -43,13 +43,13 @@ trait Configurable extends ImplicitConversions {
throw
new
IllegalStateException
(
"Value in config could not be found but it is required, key: "
+
key
+
" module: "
+
m
+
" path: "
+
p
)
}
else
return
null
}
if
(
d
==
null
)
return
Config
.
global
(
m
,
p
,
key
,
freeVar
)
if
(
d
==
null
)
return
Config
.
global
(
m
,
p
,
key
,
freeVar
=
freeVar
)
else
return
Config
.
global
(
m
,
p
,
key
,
d
,
freeVar
)
}
def
contains
(
key
:
String
,
submodule
:
String
=
null
,
freeVar
:
Boolean
=
true
)
=
{
val
m
=
if
(
submodule
!=
null
)
submodule
else
configName
val
p
=
(
if
(
submodule
!=
null
)
configName
::
configPath
else
configPath
)
.
reverse
val
p
=
(
if
(
submodule
!=
null
)
configName
::
configPath
else
configPath
)
Config
.
global
.
contains
(
m
,
p
,
key
,
freeVar
)
||
!(
Config
.
getValueFromMap
(
defaults
.
toMap
,
ConfigValueIndex
(
m
,
p
,
key
,
freeVar
))
==
None
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment