Skip to content

Commit

Permalink
[patch:lib] Add base paper categories + more aliases (#21)
Browse files Browse the repository at this point in the history
* Fix Arx::Category#full_name + add base categories

* Add more aliases to Arx::Paper
  • Loading branch information
eonu authored Mar 27, 2019
1 parent 2e05d65 commit 716b292
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/arx/categories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module Arx
'astro-ph.HE' => 'High Energy Astrophysical Phenomena',
'astro-ph.IM' => 'Instrumentation and Methods for Astrophysics',
'astro-ph.SR' => 'Solar and Stellar Astrophysics',
'cond-mat' => 'Condensed Matter',
'cond-mat.dis-nn' => 'Disordered Systems and Neural Networks',
'cond-mat.mes-hall' => 'Mesoscale and Nanoscale Physics',
'cond-mat.mtrl-sci' => 'Materials Science',
Expand All @@ -20,6 +21,7 @@ module Arx
'cond-mat.stat-mech' => 'Statistical Mechanics',
'cond-mat.str-el' => 'Strongly Correlated Electrons',
'cond-mat.supr-con' => 'Superconductivity',
'cs' => 'Computer Science',
'cs.AI' => 'Artificial Intelligence',
'cs.AR' => 'Hardware Architecture',
'cs.CC' => 'Computational Complexity',
Expand Down Expand Up @@ -60,7 +62,9 @@ module Arx
'cs.SE' => 'Software Engineering',
'cs.SI' => 'Social and Information Networks',
'cs.SY' => 'Systems and Control',
'econ' => 'Economics',
'econ.EM' => 'Econometrics',
'eess' => 'Electrical Engineering and Systems Science',
'eess.AS' => 'Audio and Speech Processing',
'eess.IV' => 'Image and Video Processing',
'eess.SP' => 'Signal Processing',
Expand All @@ -69,6 +73,7 @@ module Arx
'hep-lat' => 'High Energy Physics - Lattice',
'hep-ph' => 'High Energy Physics - Phenomenology',
'hep-th' => 'High Energy Physics - Theory',
'math' => 'Mathematics',
'math.AC' => 'Commutative Algebra',
'math.AG' => 'Algebraic Geometry',
'math.AP' => 'Analysis of PDEs',
Expand Down Expand Up @@ -102,13 +107,15 @@ module Arx
'math.SP' => 'Spectral Theory',
'math.ST' => 'Statistics Theory',
'math-ph' => 'Mathematical Physics',
'nlin' => 'Nonlinear Sciences',
'nlin.AO' => 'Adaptation and Self-Organizing Systems',
'nlin.CD' => 'Chaotic Dynamics',
'nlin.CG' => 'Cellular Automata and Lattice Gases',
'nlin.PS' => 'Pattern Formation and Solitons',
'nlin.SI' => 'Exactly Solvable and Integrable Systems',
'nucl-ex' => 'Nuclear Experiment',
'nucl-th' => 'Nuclear Theory',
'physics' => 'Physics',
'physics.acc-ph' => 'Accelerator Physics',
'physics.ao-ph' => 'Atmospheric and Oceanic Physics',
'physics.app-ph' => 'Applied Physics',
Expand All @@ -131,6 +138,7 @@ module Arx
'physics.pop-ph' => 'Popular Physics',
'physics.soc-ph' => 'Physics and Society',
'physics.space-ph' => 'Space Physics',
'q-bio' => 'Quantitative Biology',
'q-bio.BM' => 'Biomolecules',
'q-bio.CB' => 'Cell Behavior',
'q-bio.GN' => 'Genomics',
Expand All @@ -141,6 +149,7 @@ module Arx
'q-bio.QM' => 'Quantitative Methods',
'q-bio.SC' => 'Subcellular Processes',
'q-bio.TO' => 'Tissues and Organs',
'q-fin' => 'Quantitative Finance',
'q-fin.CP' => 'Computational Finance',
'q-fin.EC' => 'Economics',
'q-fin.GN' => 'General Finance',
Expand All @@ -151,6 +160,7 @@ module Arx
'q-fin.ST' => 'Statistical Finance',
'q-fin.TR' => 'Trading and Market Microstructure',
'quant-ph' => 'Quantum Physics',
'stat' => 'Statistics',
'stat.AP' => 'Applications',
'stat.CO' => 'Computation',
'stat.ME' => 'Methodology',
Expand Down
2 changes: 1 addition & 1 deletion lib/arx/entities/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Category
# @see CATEGORIES
# @return [String]
def full_name
CATEGORIES[term]
CATEGORIES[name]
end
end
end
4 changes: 4 additions & 0 deletions lib/arx/entities/paper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ def url
# The date that the paper was last updated.
# @return [DateTime]
element :last_updated, DateTime, tag: 'updated'
alias_method :updated_at, :last_updated

# @!method publish_date
# The original publish/submission date of the paper.
# @return [DateTime]
element :publish_date, DateTime, tag: 'published'
alias_method :published_at, :publish_date

# @!method title
# The title of the paper.
Expand All @@ -57,11 +59,13 @@ def url
# The primary category of the paper.
# @return [Category]
element :primary_category, Category, tag: 'primary_category'
alias_method :primary_subject, :primary_category

# @!method categories
# The categories of the paper.
# @return [Array<Category>]
has_many :categories, Category, tag: 'category'
alias_method :subjects, :categories

# Whether the paper is a revision or not.
# @note A paper is a revision if {last_updated} differs from {publish_date}.
Expand Down

0 comments on commit 716b292

Please sign in to comment.